sending data from 1 page to another

Posted by Shanky11 under VB.NET on 2/7/2013 | Points: 10 | Views : 1445 | Status : [Member] | Replies : 6
Please provide code for sending data froom one page to another




Responses

Posted by: Oswaldlily on: 2/7/2013 [Member] Starter | Points: 25

Up
0
Down
Store your data in session like this and pass to next page..

Page1
Session["User"]=txtUser.Text;

Page2:
string _user="";
_user=Session["User"].Tostring()

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 2/7/2013 [Member] Bronze | Points: 25

Up
0
Down
use Query string concept.
protected void btnAddtoList_Click(object sender, EventArgs e)
{
String Serial = txtCustomerID.Text;
Response.Redirect("SendEmail.aspx?Id=" + Serial +);
}

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kusumas on: 2/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Shanky11,


You can use many ways to pass the data from one page another page.

1)Session data is a user specific data stored into the server memory.

This is the first page code: Session[["CustomerID"]=lblCustomerId.Text;
Second page code:
long longCustomerId= Convert.ToInt64(Session["CustomerID"]);





2)QueryString is suffixed with the url of the page separated by "?" (question mark) in the form of key and value. In below code snippet, we have "CustomerId" and "com" querystring with "8" and "show" value respectively.

Example: Response.Redirect(CustomerDetails.aspx?CustomerId=8&com=show);

in Second page :if (!string.IsNullOrWhiteSpace(Request.QueryString["CustomerID"]))
{
long CustomerId= 0;
long.TryParse((Request.QueryString["CustomerId"], out CustomerId));
//here you cane use Previous page CustomerId
}







Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Satyapriyanayak on: 2/7/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
http://www.codeproject.com/Articles/14122/Passing-Data-Between-Forms

If this post helps you mark it as answer
Thanks

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 2/7/2013 [Member] Silver | Points: 25

Up
0
Down
Add one module (Project-> Add module) and declare one friend variable...

Friend passVar As String=""


First form:
add below code to click event...

passVar =TextBox1 .text


write below code as Second form_Load() event..

Label1.Text=passVar 


Regards,
Singaravel M

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 2/10/2013 [Member] Silver | Points: 25

Up
0
Down
are you got it...?

Regards,
Singaravel M

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response