Solved

Posting to another page.

Posted on 2004-08-01
6
180 Views
Last Modified: 2010-05-18
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>
0
Comment
Question by:Andrew99
  • 2
6 Comments
 
LVL 19

Expert Comment

by:drichards
ID: 11689048
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.
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 60 total points
ID: 11689094
the code above wont work ... this is because you are using postbacks which need to go back to your current page ... if you want to do this you could either

1) use plain html controls without postbacks
2) build the request on the server to submit to the other page and return the other page's output
3) use javascript to submit to the other page when it is time
0
 
LVL 4

Expert Comment

by:rohanpandya
ID: 11690872
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
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11695313
" 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
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now