Re: Posting to another page attribute: PostTargetUrl
From: Rocky Moore (gRockyMoore_at_hintsandtips.com)
Date: 02/01/04
- Next message: Von Shean: "Any Testing and QA Tools from Microsoft"
- Previous message: Cor: "Re: cache"
- In reply to: anon: "Re: Posting to another page attribute: PostTargetUrl"
- Next in thread: anon: "Re: Posting to another page attribute: PostTargetUrl"
- Reply: anon: "Re: Posting to another page attribute: PostTargetUrl"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 1 Feb 2004 02:31:42 -0800
I have to disagree with you. Processing forms is a simple matter now with
.NET and you no longer for to push people to another page just to save off
the data. That is something I would consider more of a hack.
In .NET it is a simple matter to respond to the OnClick event, which your
validators will have validated the form and you are ready to process that
data from simple server controls and store in the database. If any errors
occur you have not left he page yet and can update a status field on the
form informing them of the error while all their data is preserved. Once
the data is successfully stored, you simply do a transfer to send them to a
result page if you so desire or back to the main page.
It really does not get much easier than this. And the process keeps all
your server controls hooked for easy processing not to mention keeping your
code clean only having to deal with a single page. The processing of
regular form data has been a pain in the tush for over a decade!
-- Rocky Moore www.HintsAndTips.com - Share your tips with the world! ~~~~~~~~~ Developer Tips Welcome! ~~~~~~~~~ "anon" <anon@hotmail.com> wrote in message news:#94R5ZJ6DHA.2480@TK2MSFTNGP12.phx.gbl... > Yes, but setting the form action attribute is the BEST way to pass > information page to page. > > <asp:Button runat="server" PostTargetUrl="page2.aspx" /> > The Attribute: PostTargetUrl="page2.aspx" > > It's fastest way and most simpliest way for form data next to like the > querystring. > It's definately K.I.S.S. type of architecture. > It's got the best performance on an enterprise level or any level for that > matter > And it works, plain and simple. > > All of those other ways are messy hacks that have drawbacks one way or > another and can makes your code far far more complicated than what it should > be. > > All the other languages can do it this way, except .NET and because of that, > it's a pain in the a** to get real life questionairre form data into a > database. > > The fact that MS is addressing this issue head on is a testament to this > major major screwup > > Now, let's get back to the ORIGINAL question... is PostTargetUrl going to be > in the other HTML controls? That's what's important here and let's not SCREW > it up like MS did with 1.0 and 1.1 > > > > > "Steve C. Orr [MVP, MCSD]" <Steve@Orr.net> wrote in message > news:ugeKxCF6DHA.504@TK2MSFTNGP11.phx.gbl... > > Setting the form action attribute just isn't the ASP.NET way. > > > > Of course there are a number of ways to pass values from one page to > > another, such as using the querystring, cookies, session, > > context, saving to a temporary table in the database between each page, > etc. > > You'll have to decide which technique is best for your application. > > Here are several good articles on the subject to help you decide. > > > http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx > > > > http://www.aspalliance.com/kenc/passval.aspx > > > > http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=600 > > > > http://www.dotnetbips.com/displayarticle.aspx?id=79 > > > > Here's one nice, simple way to pass values from one page to another: > > > > 'Add data to the context object before transferring > > Context.Items("myParameter") = x > > Server.Transfer("WebForm2.aspx") > > > > Then, in WebForm2.aspx: > > > > 'Grab data from the context property > > Dim x as Integer = CType(Context.Items("myParameter"),Integer) > > > > -- > > I hope this helps, > > Steve C. Orr, MCSD, MVP > > http://Steve.Orr.net > > Hire top-notch developers at http://www.able-consulting.com > > > > > > > > "anon" <anon@hotmail.com> wrote in message > > news:u2oi0$E6DHA.3664@tk2msftngp13.phx.gbl... > > > Post Forwarding question...... > > > > > > For this control below, > > > > > > <asp:Button runat="server" PostTargetUrl="page2.aspx" /> > > > > > > The Attribute: PostTargetUrl="page2.aspx" > > > > > > Is this PostTargetUrl Attribute going to be available in the <a> and > Html > > > Controls as well as opposed to just the <asp:Button> control? > > > > > > Lots of other controls, HTML controls, <a>, <img>, etc, would like to > used > > > to post forward.... > > > > > > > > > > > >
- Next message: Von Shean: "Any Testing and QA Tools from Microsoft"
- Previous message: Cor: "Re: cache"
- In reply to: anon: "Re: Posting to another page attribute: PostTargetUrl"
- Next in thread: anon: "Re: Posting to another page attribute: PostTargetUrl"
- Reply: anon: "Re: Posting to another page attribute: PostTargetUrl"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|