R
ryanwpenfold
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.Page
Protected _intMode As PCC.Blogger.Function =
PCC.Blogger.Function.Add
Protected _intBlogID As Integer = -1
''' <summary>
''' Can be "Add" or "Edit"
''' </summary>
<System.ComponentModel.DefaultValue(GetType(PCC.Blogger.Function),
"Add")> Protected Property Mode() As PCC.Blogger.Function
Get
If BlogID = -1 Then
_intMode = PCC.Blogger.Function.Add
Else
_intMode = PCC.Blogger.Function.Edit
End If
Return _intMode
End Get
Set(ByVal value As PCC.Blogger.Function)
_intMode = value
End Set
End Property
<System.ComponentModel.DefaultValue(-1)> Protected Property BlogID()
As Integer
Get
If _intBlogID = -1 Then
Try
_intBlogID = CType(Request.QueryString("blogID"), 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.Function.Add
_intBlogID = -1
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) 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.Page
Protected _intMode As PCC.Blogger.Function =
PCC.Blogger.Function.Add
Protected _intBlogID As Integer = -1
''' <summary>
''' Can be "Add" or "Edit"
''' </summary>
<System.ComponentModel.DefaultValue(GetType(PCC.Blogger.Function),
"Add")> Protected Property Mode() As PCC.Blogger.Function
Get
If BlogID = -1 Then
_intMode = PCC.Blogger.Function.Add
Else
_intMode = PCC.Blogger.Function.Edit
End If
Return _intMode
End Get
Set(ByVal value As PCC.Blogger.Function)
_intMode = value
End Set
End Property
<System.ComponentModel.DefaultValue(-1)> Protected Property BlogID()
As Integer
Get
If _intBlogID = -1 Then
Try
_intBlogID = CType(Request.QueryString("blogID"), 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.Function.Add
_intBlogID = -1
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Properties_Set()
End If
lblAddEditBlog.Text = Mode.ToString & " Blog"
End Sub
End Class