![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] ASP.NET funny problem!!!? I insstalled .NET v2.0.50727.42, i have two pages, Get.aspx and Save.asp. There is a server side form in the Get.aspx: <form runat="server" action="Save.aspx" name="GetData"> But after runnging page when i click on the Submit button it return to Get.aspx, in the page source form's action property changed to Get.aspx, but i wrote it Save.aspx in the source file!!! How can i solve it? In the browser's source view: <form action="Get.aspx" name="GetData"> and, inside the form in Get.aspx i used ASP.NET controls, i can't move runat="server" ! |
| |
| |||
| Well, first thing to note is that you are mixing two technologies. You really don't need an aspx page to do a conventional Post. That being said, you should just replace the runat="server" from your form with method="post". Do this unless you plan on using your code-behind to process the form. Next, open your Save.aspx page so that you can view the source. Place the following above the html code and under your Page directive (I'm using C sharp but you could easily change it to VB ): <script language=cs runat=server> void Page_Load(object sender, System.EventArgs e) { myLabel_id.Text = Request.Form("myFormElementName").toString(); } </script> Now, inside the <form> tags of your Save.aspx page put the following: <asp:Label id="myFormElementName" run="server" /> run your get.aspx page and the results should post on your save.aspx page. |
| |||
| I agree with the post above me, you are mixing between two technologies. To post your page to another page, simply set the PostBackUrl property of the button or control which you wish to post to Save.aspx. This property takes a string value that points to the location of the file to which this page should post. In this case, it is Save.aspx. This means that Save.aspx now receives the postback and all the values contained in the Get.aspx controls. However all this is not needed. All you need is one page. Hope this helps. |
![]() |
| Thread Tools | |
| Display Modes | |
| |