473,396 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

When/how redirect to a different ASP .NET page

Hi;

The ASP .NET book I have only talks about putting everything in a single
aspx and aspx.cs file. However, it seems to me you want to redirect to a
different page/class for each logical page. Which brings up 2 questions:

1) When the user presses submit, is best practice to immediately redirect to
the new page and have that read the controls from the first page. Or do you
read the values from the controls and then redirect with the read values in
an object.

2) How do I redirect to another page of mine?

--
thanks - dave
Nov 19 '05 #1
4 1126
On 12 Feb 2005, "=?Utf-8?B?RGF2aWQgVGhpZWxlbg==?="
<th*****@nospam.nospam> postulated in news:52627C6F-9CD5-4669-AADC-
DE**********@microsoft.com:
Hi;

The ASP .NET book I have only talks about putting everything in a single aspx and aspx.cs file. However, it seems to me you want to redirect to a different page/class for each logical page. Which brings up 2 questions:
1) When the user presses submit, is best practice to immediately redirect to the new page and have that read the controls from the first page. Or do you read the values from the controls and then redirect with the read values in an object.

2) How do I redirect to another page of mine?

Not any more.

In ASP.NET, the usual practice is to process form variables in the
code-behind page.

Generally, you check for postback, and read the controls there and
process as you wish.
To redirect, you use the Response.Redirect method, similar to ASP.
By the way, that must be a very simple book if it deals with projects
with only one page/class?

Take a look at some of the examples provided on ASP.NET or
GotDotNet.com
-- ipgrunt

Nov 19 '05 #2
Found it:

http://msdn.microsoft.com/library/de...notherpage.asp
an
http://msdn.microsoft.com/library/de...formspages.asp

thanks - dave
"David Thielen" wrote:
Hi;

The ASP .NET book I have only talks about putting everything in a single
aspx and aspx.cs file. However, it seems to me you want to redirect to a
different page/class for each logical page. Which brings up 2 questions:

1) When the user presses submit, is best practice to immediately redirect to
the new page and have that read the controls from the first page. Or do you
read the values from the controls and then redirect with the read values in
an object.

2) How do I redirect to another page of mine?

--
thanks - dave

Nov 19 '05 #3
David Thielen wrote:
Hi;

The ASP .NET book I have only talks about putting everything in a single aspx and aspx.cs file. However, it seems to me you want to redirect to a different page/class for each logical page. Which brings up 2 questions:
1) When the user presses submit, is best practice to immediately redirect to the new page and have that read the controls from the first page. Or do you read the values from the controls and then redirect with the read values in an object.

2) How do I redirect to another page of mine?


When you design a form in asp.net, all events basically go to the same
page that display the form. You may, however, let two or more different
pages inherit from one code-behind Page class, like this:

class MyFormPage: Page
|
-- class FormDisplayPage -- ShowForm.aspx
|
-- class FormHandlePage --- ConfirmSubmit.aspx
\-- SubmitDone.aspx

Nov 19 '05 #4
Hi Dave,

Yes, the redirecting to a different page(cross-page posting) does be an
existing problem in the current ASP.NET version. And the problem has been
addressed in the ASP.NET2 which has complete cross-page posting model
support.
Currently in ASP.NET1.X, we may need to use serverside's Server.Transfer to
workaround such scenario.

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.)

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
11
by: HolaGoogle | last post by:
hi all, can you please tell me what i should do to avoid session timeout when displaying my database info in my asp form (DisplayUserDatabase.asp)??? ** actualy it does load and display the...
3
by: Justin | last post by:
Hi, Im confused here over the usage of Response.Redirect and Server.Transfer. I used frameset for my work, what are the proper usages of the two methods that seems working similar.. The...
2
by: Jim Heavey | last post by:
I have a web page which accepts a query string to retrieve the record that the user wants. The user could then select different values as which cases I am re-directing back to the same page with a...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
1
by: ticars | last post by:
I have a web page which all it does is redirect a user to a different page (the page to redirect to is based on a database lookup). I want to make it so that when a user tries to use the back...
3
by: Learner | last post by:
Hello, I have two buttons on one of my VehicleDetails.aspx page. Obiviously these two buttons takes the user to two different pages. Now my client is interested in having a linkbutton instead of...
5
by: Lupus | last post by:
Hi there! I have some strange behavior in a ASP VB.NET application. I've used response.redirect many times in different pages, and it works like a charm. However in a new page I'm making, the...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.