|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CrossPage Posting and the How Do I Webcastfrom 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 -- Application Engineer / DBA UCLA SOM lblSp_Cd.Text = String.Format("Species {1}", s.Text)
Should be lblSp_Cd.Text = String.Format("Species {0}", s.Text) Lookup String.Format in MSDN if you want more information. Unfortunately changing the {1} to [0} did not work.
I reviewed the String.format method and am still suffering from a mental block on what step I'm missing. -- Show quoteHide quoteApplication Engineer / DBA UCLA SOM "CaffieneR***@gmail.com" wrote: > lblSp_Cd.Text = String.Format("Species {1}", s.Text) > Should be > lblSp_Cd.Text = String.Format("Species {0}", s.Text) > > Lookup String.Format in MSDN if you want more information. > >
Major problem with FileUpload if bad filename
Dynamic control creation. FormView - FindControl only works for default view Launch a new browser window Creating N rows of controls Any advantage to FormView? GridView, sorting, DataTable, and typing. ObjectDataSource ... could not find a non-generic method ... that has parameters: ... enable/disable text box based on dropdownlist via javascript post-back when the filename to upload changes |
|||||||||||||||||||||||