Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session - getting value from details view

Status
Not open for further replies.

trium123

IS-IT--Management
Apr 8, 2005
15
0
0
GB
Hi All.
I'm almost there with creating my first session!!
Can anyone help me with the syntax for the following code fragment, i would like the session variable to get the nameID from DetailsView1, if i put a dot after DetailsView1 i get loads of options, but none are for the nameID. It looks like that i probably need to select a few more options from these menus but i don't know which ones..!

Session("testid") = Me.DetailsView1 ' ??????

Thanks for your help.
Regards
Ian
 
Try This
Code:
Dim dv As DetailsView = Me.DetailsView1
 Dim NameIDvar As Int32=CType(dv.FindControl("NameID"), TextBox).Text
Session("testid") =NameIDvar

you'll need to replace the nameid by find control with the name of your control that holds the nameid. I assume nameid is an integer or you'll have to change that too. Depending on the type of control (label,textbox etc) you'll have to replace that too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top