Hi,
The variable _intBlogID changes from -1 to 0 when the Mode_Get method
is called. I don't understand why this happens. I included default
property values, and that didn't help. I wrote and called the method
Properties_Set( ) and that didn't help. Can anyone provide a solution?
Please see code below.
Thanks in advance.
Ryan Penfold, Portsmouth, UK
Option Strict On
Partial Class AddEditBlog
Inherits System.Web.UI.P age
Protected _intMode As PCC.Blogger.Fun ction =
PCC.Blogger.Fun ction.Add
Protected _intBlogID As Integer = -1
''' <summary>
''' Can be "Add" or "Edit"
''' </summary>
<System.Compone ntModel.Default Value(GetType(P CC.Blogger.Func tion),
"Add")Prote cted Property Mode() As PCC.Blogger.Fun ction
Get
If BlogID = -1 Then
_intMode = PCC.Blogger.Fun ction.Add
Else
_intMode = PCC.Blogger.Fun ction.Edit
End If
Return _intMode
End Get
Set(ByVal value As PCC.Blogger.Fun ction)
_intMode = value
End Set
End Property
<System.Compone ntModel.Default Value(-1)Protected Property BlogID()
As Integer
Get
If _intBlogID = -1 Then
Try
_intBlogID = CType(Request.Q ueryString("blo gID"), Integer)
Catch ee As Exception
_intBlogID = -1
End Try
End If
Return _intBlogID
End Get
Set(ByVal value As Integer)
_intBlogID = value
End Set
End Property
Protected Sub Properties_Set( )
_intMode = PCC.Blogger.Fun ction.Add
_intBlogID = -1
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
If Not IsPostBack Then
Properties_Set( )
End If
lblAddEditBlog. Text = Mode.ToString & " Blog"
End Sub
End Class
The variable _intBlogID changes from -1 to 0 when the Mode_Get method
is called. I don't understand why this happens. I included default
property values, and that didn't help. I wrote and called the method
Properties_Set( ) and that didn't help. Can anyone provide a solution?
Please see code below.
Thanks in advance.
Ryan Penfold, Portsmouth, UK
Option Strict On
Partial Class AddEditBlog
Inherits System.Web.UI.P age
Protected _intMode As PCC.Blogger.Fun ction =
PCC.Blogger.Fun ction.Add
Protected _intBlogID As Integer = -1
''' <summary>
''' Can be "Add" or "Edit"
''' </summary>
<System.Compone ntModel.Default Value(GetType(P CC.Blogger.Func tion),
"Add")Prote cted Property Mode() As PCC.Blogger.Fun ction
Get
If BlogID = -1 Then
_intMode = PCC.Blogger.Fun ction.Add
Else
_intMode = PCC.Blogger.Fun ction.Edit
End If
Return _intMode
End Get
Set(ByVal value As PCC.Blogger.Fun ction)
_intMode = value
End Set
End Property
<System.Compone ntModel.Default Value(-1)Protected Property BlogID()
As Integer
Get
If _intBlogID = -1 Then
Try
_intBlogID = CType(Request.Q ueryString("blo gID"), Integer)
Catch ee As Exception
_intBlogID = -1
End Try
End If
Return _intBlogID
End Get
Set(ByVal value As Integer)
_intBlogID = value
End Set
End Property
Protected Sub Properties_Set( )
_intMode = PCC.Blogger.Fun ction.Add
_intBlogID = -1
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
If Not IsPostBack Then
Properties_Set( )
End If
lblAddEditBlog. Text = Mode.ToString & " Blog"
End Sub
End Class
Comment