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.ToS hortDateSt ring
txtED.Text = Calendar1.SelectedDate.ToS hortDateSt ring
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:RequiredFieldValidato r ControlToValidate="txtdoma in"
Text="Domain Name Required."
runat="server" />
</Td>
</Tr><Tr><Td>Start Date</Td>
<Td><asp:TextBox id="txtSD" name="txtSD" runat="server" />
<asp:RequiredFieldValidato r 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:RequiredFieldValidato r ControlToValidate="txtED"
Text="End Date Required."
runat="server" />
</Td>
</Tr><Tr><Td>Price</Td>
<Td><asp:TextBox id="txtPrice" name="Price" runat="server" />
<asp:RequiredFieldValidato r ControlToValidate="txtPric e"
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_S elected" runat="server" />
</form>
</body>
</Html>
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.ToS
txtED.Text = Calendar1.SelectedDate.ToS
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:RequiredFieldValidato
Text="Domain Name Required."
runat="server" />
</Td>
</Tr><Tr><Td>Start Date</Td>
<Td><asp:TextBox id="txtSD" name="txtSD" runat="server" />
<asp:RequiredFieldValidato
Text="Start Date Required."
runat="server" />
</Td>
</Tr><Tr><Td>End Date</Td>
<Td><asp:TextBox id="txtED" runat="server" name="price" />
<asp:RequiredFieldValidato
Text="End Date Required."
runat="server" />
</Td>
</Tr><Tr><Td>Price</Td>
<Td><asp:TextBox id="txtPrice" name="Price" runat="server" />
<asp:RequiredFieldValidato
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_S
</form>
</body>
</Html>
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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