M
Marcial
The following code is supposed to allow me to capture some label.text values
from a preceeding page. I have placed a link button control on "source page"
and configured the PostbackUrl property to point to the "destination page".
On the destination page I would like to retrieve the text values from the
"source page" and use them as needed. This is the basic functionality of
Crosspage posting as I understand it.
However when I run the page and click the link button I am preented wtih an
error:
NullReference was unhandled by the user code.
Object reference not set to an instance of an object.
The code below was based on an ASP.NET 2.0 How Do I Vidoe Series: Tips and
Tricks. after viewin g the souce code and search a bit fro how to debugg it
I tried adding the New keyword declarations. However the error above
contiues to appear.
Now that i've exposed myself as the newbie that i am can someone explain the
obvious to me.
Thanks in advance!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
If Not Page.IsPostBack Then
Dim c As New Label
Dim s As New Label
c.Text = Nothing
s.Text = Nothing
c = CType(PreviousPage.FindControl("CaseCounterLabel1"), Label)
s = CType(PreviousPage.FindControl("lblSpecies"), Label)
lblCaseCounter.Text = String.Format("Case Number {0}", c.Text)
lblSp_Cd.Text = String.Format("Species {1}", s.Text)
End If
End Sub
from a preceeding page. I have placed a link button control on "source page"
and configured the PostbackUrl property to point to the "destination page".
On the destination page I would like to retrieve the text values from the
"source page" and use them as needed. This is the basic functionality of
Crosspage posting as I understand it.
However when I run the page and click the link button I am preented wtih an
error:
NullReference was unhandled by the user code.
Object reference not set to an instance of an object.
The code below was based on an ASP.NET 2.0 How Do I Vidoe Series: Tips and
Tricks. after viewin g the souce code and search a bit fro how to debugg it
I tried adding the New keyword declarations. However the error above
contiues to appear.
Now that i've exposed myself as the newbie that i am can someone explain the
obvious to me.
Thanks in advance!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
If Not Page.IsPostBack Then
Dim c As New Label
Dim s As New Label
c.Text = Nothing
s.Text = Nothing
c = CType(PreviousPage.FindControl("CaseCounterLabel1"), Label)
s = CType(PreviousPage.FindControl("lblSpecies"), Label)
lblCaseCounter.Text = String.Format("Case Number {0}", c.Text)
lblSp_Cd.Text = String.Format("Species {1}", s.Text)
End If
End Sub