Monday, March 26, 2012

Pass the Items on a post...??

Hi I have to pass the items on a Post to another page using vb.net....I know the following solutions are available for that...

(1) Use an HTML instead of a web form.

(2) Create a simple javascript function to alter the page behavior on the client...But there is a third method which is easy and good that is

(3) Pass the items on a post. Create a custion function to read the current items and send them via an HTTP post...

I neved attempted this and I donno how to do this...Can ne1 help me out how to do this...Ur help will be appreciatedAnd also I do not want to use Query Strings...I know we can redirect that using query strings...But is there any other way like the 3rd one without using query strings...
Here's a code sample that shows how to do what you want:

http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/intro/intro6.src
HI darellnorton,

Thanks for ur reply...But itz posting back to the same form which is not what I want...
One of the biggest differences between ASP and ASP.NET is that in ASP.NET, a Web Form must post back to itself rather than post to a different page.

Historically, developers posted to a different page by setting the form's action attribute. Posting to a separate page used to be a good idea because it made for a cleaner separation of code from HTML. Now, because ASP.NET handles events in the same Web Form in which they're raised, the form must post back to the same page. Even if you set the action attribute of the form to a different page, the Web server finds the runat="server" attribute setting and overrides your action value.
What you want is coming with ASP.NET v2.0, which will be available some time in 2005.
Hi DarrellNorton,

Thanks for ur reply..Yeah I have checked that it is gonna be released in aspv2.0...But how to do that if at all I want to implement it...Is there any way using the javascript to do that...Ur help will be appreciated
What you can do is use Server.Transfer(newPage.aspx), which will transfer control to the new page specified as well as the request object, so data in the request object will be available on the new page.

Try that and let me know how it works.

0 comments:

Post a Comment