querystring

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
 
W

William F. Robertson, Jr.

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

if ( s == "Edit" )
//do edit stuff
else if ( s == "New" )
//do new stuff
}
}
 
G

Guest

Pretty much like classic ASP

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

....that type of thing
 
S

Steven Cheng[MSFT]

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
 
S

Steven Cheng[MSFT]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top