• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Retrieve Variable from Hyperlink

I have passed a variable from one page to another but I don't know how to retrieve it.  My adress bar on my page displays http://mysite/notes.aspx?Item=12345

I want to set<asp:Label Text = the item number from above.
What is the code to do so.
Thanks.
0
sbdt8631
Asked:
sbdt8631
  • 2
1 Solution
 
pateljituCommented:
Please try this c# sample:

Code Behind:
int itemNO = 0;

itemNO  = Request.QueryString["Item"].ToString;
lblItem.text = itemNO.toString();


.ASPX:
<asp:Label ID="lblItem" runat="server" Text="Label" />
0
 
pateljituCommented:
Also please look at this article for more detail:

http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx
0
 
sbdt8631Author Commented:
Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now