Wednesday, March 21, 2012

Passing Variables to another webpage

Pls. help!!!!!!! jas started in ASP.NET.

How Can I Pass the text in a textbox to another webpage?
Thanks in advance . . .You have a number of ways in .NET to pass information but the whole point of .NET is that controls (textboxes) are programmatically accessible so in your postback you basically just say
sString = textbox1.text

However, if you're wanting to pass it to a completely different page, then you'd need to redirect and use either querystring, session or global module (type properties0 to hold the data.

eg

Sub onButtonClick (...)
sString = textbox1.text
response.redirect("myNewPage.aspx?ss=" & sString & "")

End sub
Take a look at the Global.asax File.

//-- define the vaiable

public class Global : System.Web.HttpApplication
{

//...

public static int anwStatus;

//...

}

//-- use the variable, e.g.
Global.anwStatus = 1;

by
Andreas

0 comments:

Post a Comment