Link to home
Start Free TrialLog in
Avatar of Andrew99
Andrew99

asked on

Posting to another page.

Hi I am faily new to ASP.net.

I am trying to understand how posting works.

This script I have has a calender in it which when the date is selected it puts the date into two input boxes.  Now when I hit the submit button, I don't want it posting to the same page, i want it to post to a different page.  How would I do that?


<Html>
<Head>
<script language="VB" runat="server">

    Sub Date_Selected(sender As Object, e As EventArgs)
            txtSD.Text = Calendar1.SelectedDate.ToShortDateString
            txtED.Text = Calendar1.SelectedDate.ToShortDateString
    end sub
    </script>
</Head>
<Body>
<Form runat=server method="post" action="test.php3" name="frmpInfo">
<Table>
<Tr><Td>Domain Name</Td>
<Td><asp:TextBox id="txtdomain" name="txtdomain" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="txtdomain"
Text="Domain Name Required."
runat="server" />
</Td>

</Tr><Tr><Td>Start Date</Td>
<Td><asp:TextBox id="txtSD" name="txtSD" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="txtSD"
Text="Start Date Required."
runat="server" />
</Td>


</Tr><Tr><Td>End Date</Td>
<Td><asp:TextBox id="txtED" runat="server" name="price" />
<asp:RequiredFieldValidator ControlToValidate="txtED"
Text="End Date Required."
runat="server" />
</Td>

</Tr><Tr><Td>Price</Td>
<Td><asp:TextBox id="txtPrice" name="Price" runat="server" />
<asp:RequiredFieldValidator ControlToValidate="txtPrice"
Text="Price Required."
runat="server" />
</Td>

</Tr><Tr><Td>Extra Notes</Td>
<Td><textarea></textarea>
</Td></Tr>
</table>
<BR>
<input type="Submit" name="Submit" id="Submit">
<BR>
<asp:Calendar id=Calendar1 onselectionchanged="Date_Selected" runat="server" />

</form>
</body>
</Html>
Avatar of drichards
drichards

In the action element of the form, just put the URL where you want the data to be posted.  It doesn't have to be the current page.
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi

        In the action element of the form put URL of page on which you want to transfer or put use Respose.Redirect(URL of the page) on the click event of the sumit button.


 Best Luck
" In the action element of the form put URL of page on which you want to transfer or put use Respose.Redirect(URL of the page) on the click event of the sumit button" that wont send the form values