Private Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NextPage.Click
Session.Add("Action", txtName.Text)
Response.Redirect("Second.aspx")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ddlGet.Items.Add(Session("Action"))
End Sub
annoscia
Member
22 Points
75 Posts
Sending textbox data to another asp web page
Feb 28, 2013 10:24 AM|LINK
Hi All,
I am trying to pass textbox data to another page, i can do this by using the following code:
Page 1:
//send session name to user accounts age to view information Session["name"] = txtUser.Text; Server.Transfer("~/Loggedin/UserAccount.aspx");Page 2:
//retrieve the data passed from projects ppage string a = Session["name"].ToString();The problem is have is binding the data to a dropdown list on page 2, i try the following code but the dropdown list is just empty:
//retrieve the data passed from projects ppage string a = Session["name"].ToString(); cmbUsers.Text = a;raghavendra ...
Participant
1890 Points
435 Posts
Re: Sending textbox data to another asp web page
Feb 28, 2013 10:38 AM|LINK
In the page1
private void Button1_Click(object sender, System.EventArgs e) { Response.Redirect("Page2.aspx?name=" + TextBox1.Text); }in page2
private void Page_Load(object sender,System.EventArgs e) { DropDownList.SelectItem.Text= Request.QueryString["name"]; }farooque84
Participant
1358 Points
321 Posts
Re: Sending textbox data to another asp web page
Feb 28, 2013 11:00 AM|LINK
Hi,
Use Below code for your requirement,
Private Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NextPage.Click
Session.Add("Action", txtName.Text)
Response.Redirect("Second.aspx")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ddlGet.Items.Add(Session("Action"))
End Sub
Black Day
Member
65 Points
41 Posts
Re: Sending textbox data to another asp web page
Feb 28, 2013 11:49 AM|LINK
hi
protected void btn_click(object sender ,EventArgs e)
{
response.redirect("ABC.aspx?txtvalue="+txtbox.text);
}
protected void Page_Load(object sender, EventArgs e)
{
string value=request.Querystring["txtvalue"].tostring();
ddl.Items.Add(value);
}
Nilesh Dhande
annoscia
Member
22 Points
75 Posts
Re: Sending textbox data to another asp web page
Mar 01, 2013 09:41 AM|LINK
Many thanks for this, how would i send multiple data across?
farooque84
Participant
1358 Points
321 Posts
Re: Sending textbox data to another asp web page
Mar 01, 2013 12:29 PM|LINK
Hi,
Check below URL for your requirement,
http://forums.asp.net/t/1677543.aspx/5/10