Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Posting to another page.

Posted on 2004-08-01
6
Medium Priority
?
191 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 240 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

618 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