Q
Problem solve Get help with specific problems with your technologies, process and projects.

Sending to another page

I'm new to ASP.NET. When I send a page to another page and try to retrieve a value with request.form ("namevariabel"), it's always null. And when I try to see if there is a key in request.form.haskeys, it returns false (obviously it isn't). But when I'm not to using an ASP.NET Web form component and try manually using an HTML component, it works just fine.
It depends on how the "sending to another page" is done. If you perform a Response.Redirect, you effectively lose everything from the initial request. You should use Server.Transfer for this purpose. You can pass additional information from Page1 to Page2 by using the HttpContext.Current.Items, for example, if prior to "sending" to Page2, Page1 performs some processing and loads some information for Page2 to use. The information in HttpContext.Items is called "transient state" as it only lives during the processing of the single current request.

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

Close