I m confused that how can i post current page to different Aspx page.please help me.Please explain me by giving some suitable examples.
One way is to pass it through a querystring using response.redirect. e.g: (just typing this into the browser, but you should get the drift. Private Sub Submit1_Onclick(Byval sender..... etc) Response.Redirect("formhandler.aspx?id=" & Textbox1.Text & "&page=" & TextBox2.Text "&var1=" & Textbox3.Text) End Sub Code (markup): There is probably a better way, but that is all I have ever had to do...
Hi, You can also send your button to a sub which will store the data from your form into a viewstate or session variables and you can retrive them from other pages. as long as your session is still active.
What version of ASP.NET are you using? Am sure you'll be using 2.0 +? Since 2.0 they introduced the cross-page postback feature see msdn for details: msdn.microsoft.com/en-us/library/ms178139.aspx
Response.Redirect("page.aspx"); you can put this in the codebehind of a button, or something. regards
what do you mean by saying "post current page". Do you want to post all the form element values or just perform a simple redirection ? If redirection then use Response.Redirect("yourpage.aspx") Otherwise you can use crosspage postbacks or you can store values in session (no really recommended). Also you can create properties on the first page (public properties) and then add refference to this page into second page. I would not recommend sending form params in url (GET) unless you know and you make sure that length or the url will not exceed the max length for different browsers. Also you need to encode url if you choose this method. hope that helps.
I guess you use something like submit button on the form - at this case specify target page in the <asp:Button PostBackUrl=".."> property.
In a case of a simple form (not asp) you can specify <form action=".."> attribute with the same effect - data will be posted to the url specified in the "action"
If you want to change the default start page of an application you can right click on the desired page in the explorer pane in visual studio and set it as the starting page of the application. Alternatively, you can set it via IIS. As other people have suggested you can also use the following code in the Page_Load event; Response.Redirect("NAMEOFPAGE.aspx); However; I would not suggest doing so if it is a public application and PageRank is important as Google frown upon redirects on homepages so doing so will screw with your SEO Hope this helped mate.
with the help of response.redirect("pagename.aspx?ab="+textbox1.text+"); pagename.aspx is name of page where u want to send the data.