Solved

Posting to another page.

Posted on 2004-08-01
6
187 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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