web forms flow

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
In traditional asp form, there is an action field in a form, any time the
page is valid, after click the submit button, the next page comes up based on
the value in the action field.
In asp.net, in the sumit_click sub, after validating the all the fields in a
form, do you always use response.redirect or reponse.transfer to go to the
next page, any other ways? what's the exactly difference or which one will be
better?
 
You would usually use Response.Redirect. There is also Server.Transfer, but
that transfers the page without letting the client browser know, so the old
page would still be in the URL. In what I've seen, Response.Redirect is a
pretty standard way to do it.

Also, submit_click would normally not just validate the fields - it would
also process the page. So you would not redirect to another page to have it
add a row in the database, for example. You would do it right in your event
handler, then redirect to the next page that is the logical next page in the
application.
 
Thank you, Marina, for your expert opinions.
Your reply give me a chance to ask you another question.
Let's assume I inserted a row of user data in the first web form, at that
time,
the web form doesn't present the credit card information for payment yet or
I still need a couple more forms to collect more user data.
after user input other data/credit card number etc. and the payment or
other insert action in other forms are failed, what should I do with the user
data I inserted to the tables in the former pages already?
 
It all depends on your flow. In the case of the first page really only
collecting parts of the data, I wouldn't really insert that into a table
that holds only permanent custom requests. My example was pointing out that
typically a page will deal with its own data, and that was an example i
gave. I didn't mean to imply that it must always save its data to the
database even when it logically doesn't make sense to do so.

In your scenario it may make sense to hold on to the data in session
variables, redirect to the next page, etc, until you are ready to add data
to the database. In this case you are vulnerable to session time out
situations, although it may be acceptable for your application.
 
OK, I understand you what you mean. For the session expiration issue.
I have heared I can change session expiration default value from 20 min.
to longer time in web.config file, what I don't know how yet.
 
Hi Betty,

If you're using ASP.NET 2.0 to build the web application, you can also
consider the following means:

1. Use the cross-page post back to post one webform page to another webform
page, thus, the form data on previous form can be forwareded to the next
form page through buildin means. Also, cross-page post allow us to access
control collection in previous page from target page.

#Cross-Page Posting in ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/library/ms178139.aspx

2. ASP.NET 2.0 provide a buildin Wizard web server control which can help
provide wizard/steps based work flow on single page. This is also a
possible approach(put all the input in single page).

#Wizard Web Server Control (Visual Studio)
http://msdn2.microsoft.com/en-us/library/wsdd9x19(en-US,VS.80).aspx

Hope this also helps.

Steven Cheng
Microsoft Online Support

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



--------------------
| Thread-Topic: web forms flow
| thread-index: AcYjewl2EaALd/aURjWDwU9lh5MCFQ==
| X-WBNR-Posting-Host: 12.25.78.230
| From: "=?Utf-8?B?YzY3NjIyOA==?=" <[email protected]>
| References: <[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: web forms flow
| Date: Fri, 27 Jan 2006 11:51:17 -0800
| Lines: 82
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:374123
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| OK, I understand you what you mean. For the session expiration issue.
| I have heared I can change session expiration default value from 20 min.
| to longer time in web.config file, what I don't know how yet.
| --
| Betty
|
|
| "Marina Levit [MVP]" wrote:
|
| > It all depends on your flow. In the case of the first page really only
| > collecting parts of the data, I wouldn't really insert that into a
table
| > that holds only permanent custom requests. My example was pointing out
that
| > typically a page will deal with its own data, and that was an example i
| > gave. I didn't mean to imply that it must always save its data to the
| > database even when it logically doesn't make sense to do so.
| >
| > In your scenario it may make sense to hold on to the data in session
| > variables, redirect to the next page, etc, until you are ready to add
data
| > to the database. In this case you are vulnerable to session time out
| > situations, although it may be acceptable for your application.
| >
| > | > > Thank you, Marina, for your expert opinions.
| > > Your reply give me a chance to ask you another question.
| > > Let's assume I inserted a row of user data in the first web form, at
that
| > > time,
| > > the web form doesn't present the credit card information for payment
yet
| > > or
| > > I still need a couple more forms to collect more user data.
| > > after user input other data/credit card number etc. and the payment
or
| > > other insert action in other forms are failed, what should I do with
the
| > > user
| > > data I inserted to the tables in the former pages already?
| > > --
| > > Betty
| > >
| > >
| > > "Marina Levit [MVP]" wrote:
| > >
| > >> You would usually use Response.Redirect. There is also
Server.Transfer,
| > >> but
| > >> that transfers the page without letting the client browser know, so
the
| > >> old
| > >> page would still be in the URL. In what I've seen, Response.Redirect
is a
| > >> pretty standard way to do it.
| > >>
| > >> Also, submit_click would normally not just validate the fields - it
would
| > >> also process the page. So you would not redirect to another page to
have
| > >> it
| > >> add a row in the database, for example. You would do it right in
your
| > >> event
| > >> handler, then redirect to the next page that is the logical next
page in
| > >> the
| > >> application.
| > >>
| > >> | > >> > Hi all,
| > >> > In traditional asp form, there is an action field in a form, any
time
| > >> > the
| > >> > page is valid, after click the submit button, the next page comes
up
| > >> > based
| > >> > on
| > >> > the value in the action field.
| > >> > In asp.net, in the sumit_click sub, after validating the all the
fields
| > >> > in
| > >> > a
| > >> > form, do you always use response.redirect or reponse.transfer to
go to
| > >> > the
| > >> > next page, any other ways? what's the exactly difference or which
one
| > >> > will
| > >> > be
| > >> > better?
| > >> > --
| > >> > Betty
| > >>
| > >>
| > >>
| >
| >
| >
|
 
Hi Steven,
Thank you so much. I am using asp.net 1.1. I didn't look at asp.net 2.0 yet.
I am still using visual studio.net 2003. If I download 2005. are all those
web server controls for asp.net 2.0 in vs.net 205?
 
Thanks for your response Betty,

Yes, of course. If you're using VS 2005(or visual web developer express),
all the buildin ASP.NET 2.0 webcontrols are available in the ToolBox. Also,
some ASP.NET 1.1 compatible controls can also be used in aspx page(add them
manually) though they're not in toolbox by default. Anyway, you can have
a look at the wizard control in 2.0.

Hope this helps.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Steven,
If I download VS 2005. Would my old asp.net application developed with .net
2003 will have any problems? Is it Ok to install both .net 2003 and VS 2005?
Thank you
 
You can install/run simultaneously both
VS 2003/.Net 1.1 and VS 2005/.net 2005.

No problem...

Just make sure your 1.1 apps are targeting the .net framework 1.1,
and that the 2.0 apps are targeting the .net framework 2.0.

You can do that in the "ASP.NET" tab of the Application's Properties in the IIS Manager.



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
c676228 said:
Steven,
If I download VS 2005. Would my old asp.net application developed with .net
2003 will have any problems? Is it Ok to install both .net 2003 and VS 2005?
Thank you
 
Juan,
Great. It seems that I have difficult to find
"ASP.NET" tab of the Application's Properties in the IIS Manager.
can you give more instruction?
Thank you.
 
Open the IIS Manager
( Start Menu --> Programs --> Administrative Tools
--> Internet Information Services ( IIS ) Manager )

Scroll on the left to "Web Sites" --> "Default Web Site"
--> Any of your applications and select it.

Right-click the application and select "Properties".
Then, select the "ASP.NET" tab.

You should see a dropdown box with the choices available
( usually 1.1.4322 and 2.0.50727... )

Then, select the target .Net Framework you want for your Application.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Hi Juan,
Thanks for your reply. I don't see the asp.net tab. I only have see virtaul
directory, documents, directory security etc. Do I need to install something,
I have .net framework 1.1.
Thank you.
 
Hi Betty,

The "ASPNET" tab will appear in the IIS manager's virtual directory
property dialog after we install .net framework 2.0/ASP.NET 2.0 on the
server. If you have already installed asp.net 2.0 and didn't see this tab,
there could be something incorrect with the installation.

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.)
 
Hi Betty,

Sure there has. And actually the .net framework 2.0 classes and ASP.NET 2.0
controls become available just after you've installed the .net framework
2.0 on your server. And the Visual Studio 2005 ide is just a development
tool which help conveniently use them when developing your ASP.NET 2.0
pages(through toolbox). :-)

Please let me know if you have anything else unclear.

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