Control value from one page to the other
-
I want to use textbox value(text) in another asp.net page. eg. displaying txtName.Text from page1 in lblName in the next page OR use that value as a parameter passed to method calling under a button in the next page.
ML Lingwati
-
I want to use textbox value(text) in another asp.net page. eg. displaying txtName.Text from page1 in lblName in the next page OR use that value as a parameter passed to method calling under a button in the next page.
ML Lingwati
Use Session. Check this link.[^]
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
I want to use textbox value(text) in another asp.net page. eg. displaying txtName.Text from page1 in lblName in the next page OR use that value as a parameter passed to method calling under a button in the next page.
ML Lingwati
LucBite wrote:
I want to use textbox value(text) in another asp.net page. eg. displaying txtName.Text from page1 in lblName in the next page OR use that value as a parameter passed to method calling under a button in the next page.
You can use session. Alternatively you can use PostBackURL features of .Net. For ex: Page1.aspx: ----------- <asp:textbox id="txt1" runat="server" ></asp:textbox> <asp:button id="Button1" postbackurl="~/page2.aspx" runat="server" text="Button" /> Page2.aspx: ----------- add this line under page directive: <%@ previouspagetype virtualpath="~/page1.aspx" %> Page2.aspx.cs: ----------- TextBox txt = (TextBox)PreviousPage.FindControl("txt1"); Response.Write( txt.Text);