locked
how to execute submit for form,please? RRS feed

  • Question

  • i use vb,i want realiztion submit form on server

    Send.aspx source code:

    %@page language="vb"%

    <script runat="server">

    private sub UserClick(sender as object,e as eventArgs)

    if len(TestBox.text)>0 then

    call TestSend(TestBox.text)

    else

    response.write("disabled submit")

    end if

    end sub

    private sub TestSend(t as string)

    'on here i want execute form(TestForm action) submit to get.aspx,and must use post

    ' method.

    'If form property runat="server" ,action will normal execute send to get.aspx,and can not execute check TestBox value, runat="server" will can not execute action="get.aspx" 

    end sub

    </script>

    <form runat="server" action="get.aspx" id="TestForm">

    input a test value:<asp:textbox id="TestBox" runat="server"></asp:textbox>

    <asp:button runat="server" onclick="UserClick" text="test">

    </form>

    I mainly want to realize such function,When the user input data satisfies the condition submits this formWhen the user input data does not satisfy the condition does not carry out submitsSubmits the form time must use "post".What method has to be possible to achieve?Hoped fellow friends can help me to write an exampleServer.Transfer,Response.Redirect,Response.Redirectlocation these are not all goodI mainly when satisfy the condition submitted the form in the code,Thanks

    • Moved by VMazur Wednesday, March 11, 2009 9:53 AM Post is off topic (Moved from ADO.NET Data Providers to Off-Topic Posts (Do Not Post Here))
    Thursday, February 9, 2006 3:09 AM

All replies

  • YOu should look into requiredfieldvalidators.  For future reference, there are asp.net forums about, but none of them are here.  www.codeproject.com is one place that has forums for asp.net.

     

     

    Thursday, February 9, 2006 4:24 AM
  • thanks,i not check data,and i want encryption data from my form.and i want use webhttprequest method
    Thursday, February 9, 2006 6:05 AM
  • have pepole help me?

          Dim url2 As String = "http://localhost/ms.aspx"
          Dim req As HttpWebRequest = CType(WebRequest.Create(url2), HttpWebRequest)
          req.MaximumAutomaticRedirections = 1
          req.AllowAutoRedirect = True
          Dim rs As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse)

    'this code not send data,and not redirection to "ms.aspx"

    Thursday, February 9, 2006 6:08 AM
  • 'add code

    req.method="post"

    req.create("ms.aspx")

    req.contenttype="......."

    'if add this code,the same have problem.

    Thursday, February 9, 2006 6:11 AM
  • I have a VERY similar issue with one exception. My Form Action calls an .aspx file which reside OUTSIDE of my application. For this reason, I cannot use the Server.Transfer or Server.Execute methods which I'm pretty sure should work for you since the two .aspx files reside in the same application.

    Good Luck!

    ASP.Net VB Web Developer
    Tuesday, March 10, 2009 3:57 PM