Solved

Posting to another page.

Posted on 2004-08-01
6
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

695 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