Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 30, 2013 12:18 AM by Decker Dong - MSFT
Member
1 Points
5 Posts
Jan 28, 2013 06:07 AM|LINK
hi...
i m new on asp.net and i do't now how to get the value of a cell in gridview on another page...
Contributor
2055 Points
586 Posts
Jan 28, 2013 06:14 AM|LINK
if you want to pass a data from one page to another page simply use Session or Query String.
3990 Points
845 Posts
Jan 28, 2013 06:16 AM|LINK
Either use query string or use session
METHOD 1:
string val =GridView1.Rows[0].Cells[0].Text;
Response.Redirect("YourPage.asx?cellvalue=" + val);
METHOD 2 :
Session["cellvalue"] = GridView1.Rows[0].Cells[0].Text;
and get these values as below:
myval =Request.QueryString ["cellvalue"];
or
myval = Session["CellValue"].toString();
Jan 28, 2013 06:33 AM|LINK
i want to get the value of selected row when i click on button.. in this case how can use the index of row??
Jan 28, 2013 07:47 AM|LINK
refer this,
http://www.dotnetfunda.com/articles/article442-how-to-get-the-values-of-selected-row-from-a-gridview-using-aspnet.aspx
All-Star
118619 Points
18779 Posts
Jan 30, 2013 12:18 AM|LINK
jamshaid555 i want to get the value of selected row when i click on button.. in this case how can use the index of row??
After selected a GridView's Row, please use GridView.SelectedIndex
jamshaid555
Member
1 Points
5 Posts
value of a cell in gridview
Jan 28, 2013 06:07 AM|LINK
hi...
i m new on asp.net and i do't now how to get the value of a cell in gridview on another page...
g_mani
Contributor
2055 Points
586 Posts
Re: value of a cell in gridview
Jan 28, 2013 06:14 AM|LINK
if you want to pass a data from one page to another page simply use Session or Query String.
Please Mark as Answer If this is helpful.
umairaslam22
Contributor
3990 Points
845 Posts
Re: value of a cell in gridview
Jan 28, 2013 06:16 AM|LINK
Either use query string or use session
METHOD 1:
string val =GridView1.Rows[0].Cells[0].Text;
Response.Redirect("YourPage.asx?cellvalue=" + val);
METHOD 2 :
Session["cellvalue"] = GridView1.Rows[0].Cells[0].Text;
and get these values as below:
myval =Request.QueryString ["cellvalue"];
or
myval = Session["CellValue"].toString();
MCP
Blog
Please remember to Mark as answer if any post help you , it help others to find right solution in less time
jamshaid555
Member
1 Points
5 Posts
Re: value of a cell in gridview
Jan 28, 2013 06:33 AM|LINK
i want to get the value of selected row when i click on button.. in this case how can use the index of row??
g_mani
Contributor
2055 Points
586 Posts
Re: value of a cell in gridview
Jan 28, 2013 07:47 AM|LINK
refer this,
http://www.dotnetfunda.com/articles/article442-how-to-get-the-values-of-selected-row-from-a-gridview-using-aspnet.aspx
Please Mark as Answer If this is helpful.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: value of a cell in gridview
Jan 30, 2013 12:18 AM|LINK
After selected a GridView's Row, please use GridView.SelectedIndex