forms in

Results 1 to 2 of 2

Thread: forms in

  1. #1
    Join Date
    Dec 1969

    Default forms in

    If you put runat=server in a form tag, can you not post to another page? I want to use the field validators but I want to go to a different page afterwards. I can&#039;t seem to get it to work. <BR><BR>my form tag looks like this:<BR><BR>&#060;form id="Form1" method="post" action="info.aspx" runat="server"&#062;<BR><BR>but when I go to debug it, it posts back to the original page. Any ideas? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default Whatcha gotta do

    I assume you have a button that, when clicked, submits the form, something like:<BR><BR>&#060;asp:button id="btnSubmit" runat="server" Text="Submit" /&#062;<BR><BR>within your server-side form. In that, place an OnClick event handler (if you don&#039;t already have one), like:<BR><BR>&#060;asp:button id="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" /&#062;<BR><BR>Then, in your btnSubmit_Click event handler, do a Response.Redirect to the page you want to send the user to after they submit the form:<BR><BR>Sub btnSubmit_Click(sender as Object, e as EventArgs)<BR> Response.Redirect("somePage.aspx")<BR>End Sub<BR><BR>hth

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts