I have passed a value through a url to a C# .net page using query string. The url of the page looks like this:
http://contoso.com/products.aspx?field1=value1
And in C#, I have this to catch it:
String myValue = Request.QueryString["field1"];
What im looking to do is use this value in the page, something like this:
<h1><%# Eval("myValue") %></h1>
How would I go about doing this? Obviously this HTML code doesn’t work. I have exhausted some google searches on the subject so any information would be appreciated!!
You can either create a
Propertyon your page and use code tags, or set theh1tag asrunat="server"and set the value like that.Property:
Then in your markup:
Alternatively, using the
runat="server"method on theh1tag:Markup:
Code: