vb.net form submit

I have a form action that I need to use.  I need to take my vb.net page and submit my form fields to:  http://this.site.to.process

the action on the form does not work.  

I thought this would be an easy one until i started working with it.

I just want to  --> submit form --> update my table  --> submit values to the form action page.

Any help with this would as always be greatly appreciated.
tjpalAsked:
Who is Participating?
 
Alfred A.Connect With a Mentor Commented:
Using PostBackURL property in a Button will automatically redirect user to the set URL and will not execute the OnClick Server event.  The reason why it will not execute the server event is that PostBackURL property is rendered as a javascript.  See example below:

onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button1", "", false, "", "http://www.localhost.com/webform4.aspx";, false, false))" id="Button1" />

You could actually try doing your update function in the other page if you have control over it.  For example, if you have a textbox in the original page say TextBox1, you could retrieve its value doing the following:

Request.Form("TextBox1").ToString

You could use the PreviousPage property of the Page Class in retrieving your original form information and then update your database from there.

http://msdn.microsoft.com/en-us/library/ms178139.aspx

0
 
silemoneCommented:
vb.net is a server language...why not just copy the code to the code behind and process there?  There's no need to go to another page to process since vb, c-sharp is already capable of traveling to the server.  If it was javascript, then you would want to work this way.  
0
 
tjpalAuthor Commented:
I have to post my data to another website not within my site example:  mysite.com has to post my data to http://yoursite.com
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
tjpalAuthor Commented:
Thanks Alfred, the postbackURL is close, I also need to update my table first , then post to the url.

0
 
tjpalAuthor Commented:
What I was hoping was for something like this:  <asp:Button id="SaveButton" Text="Update & Submit Job" PostBackUrl="http://dpi.theOtherSite.com/webservices/dpitg.aspx" onclick="SaveButton_Click" runat="server" />
0
 
Alfred A.Commented:
OK.  Why don't you just use Response.Redirect with QueryStrings inside your SaveButton_Click?  You call Response.Redirect with values to be passed in query string variables after updating your table.

Check this out:

http://www.sswug.org/articles/viewarticle.aspx?id=39260

http://ramanisandeep.wordpress.com/2008/11/21/passing-values-from-one-page-to-another-page-aspnet/
0
 
tjpalAuthor Commented:
I could use response redirect, but isn't there a limit of the string?  I have about 20 form fields I need to pass including a text block.  I'm not sure if it will successfully send.
0
 
tjpalAuthor Commented:
Alfred,

I think all along I was making the issue larger than what it was.  I was worried about session, when all I really needed to do was pass a querystring of just the ID to the asp classic page and build a query from there and use a body on submit to push my form action.

Works well.

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.