there are a variety of ways to do this
response.write
assign the value to any type of control visual control
<%=MyVariable%>. this requires a public property so the code behind would look like this
Code:
public call MyPage : Page
{
public MyVariable { { get return "Hello World"; } }
}
Thanks Jason, for your help.
I am having trouble getting the above to work.
It is throwing errors, it complains about the semicolons and {} positions but I can't get it to work.
The situation is that I have done a load of number crunching in the code behind and have ended up with two INTs that I want to pass to the HTML just to add to the end of a URL as a query string.
the code i provided is c#, if you're using VB you'll need to transpose it.
the server side controls are designed to reduce the mark/server code interaction. if you need the values for a link either use Response.Redirect() or apply the values the to Hyperlink.NavigateURL.
ASP.Net is a drastic change from ASP. while you could code them the same, it's not the way the language was intended to be used.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.