how to execute submit for form,please?

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



Answer this question

how to execute submit for form,please?

  • GarryHarrison

    'add code

    req.method="post"

    req.create("ms.aspx")

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

    'if add this code,the same have problem.


  • jciurlin

    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.



  • Jeremy Sheldon

    thanks,i not check data,and i want encryption data from my form.and i want use webhttprequest method
  • Fametown.com

    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"


  • how to execute submit for form,please?