querystring

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I'm new to the asp.net world and on my app i have a querystring to pass data
to the update screen.
can querystrings still be used in asp.net or no?

Example:

response.redirect("update.aspx?Status=Edit")
or
response.redirect("update.aspx?Status=New")

how can i capture the Status and execute the correct query on my update.aspx
page?

thanks
 
Page_Load( ... )
{
if ( !Page.IsPostback )
{
string s = Request.QueryString["Status"]

if ( s == "Edit" )
//do edit stuff
else if ( s == "New" )
//do new stuff
}
}
 
Pretty much like classic ASP

If Request.QueryString("Status")="Edit

....that type of thing
 
Hi Mike,

Yes, as other members have mentioned, it's rather easier to handle
querystring in ASP.NET, just use the HttpRequest.QueryString collection,
here is the reference in MSDN:

#HttpRequest.QueryString Property
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebHttpRequest
ClassQueryStringTopic.asp?frame=true

In addition, here are some other tech articles on migrating from asp to
asp.net

#Migrating to ASP.NET: Key Considerations
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspnetmigrissues.asp?fra
me=true

#Converting ASP to ASP.NET
http://msdn.microsoft.com/library/en-us/dndotnet/html/convertasptoaspnet.asp
?frame=true

#ASP to ASP.NET Migration Assistant
http://msdn.microsoft.com/asp.net/using/migrating/aspmig/aspmigasst/default.
aspx

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Hi Mike,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top