• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

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.
0
tjpal
Asked:
tjpal
  • 5
  • 3
1 Solution
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
Alfred A.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(&quot;Button1&quot;, &quot;&quot;, false, &quot;&quot;, &quot;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
 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now