how to to fetch gridviewi value from another page.

Posted by Oswaldlily under ASP.NET on 5/30/2012 | Points: 10 | Views : 722 | Status : [Member] | Replies : 2
Unable to cast object of type 'System.Int32' to type 'System.Web.UI.WebControls.GridViewRow'.

foreach (GridViewRow g in ((ArrayList)(Session["al"]))
{
str1[i] = ((System.Web.UI.WebControls.Label)g.FindControl("lbl1No")).Text;
str2[i] = ((System.Web.UI.WebControls.Label)g.FindControl("lbl2No")).Text;
}

why this error??

i have to fetch gridviewi value from another page.
foreach (GridViewRow g in ((Gridview)(Session["gview"]))
If i use like this my gridview is empty..so hw to control??




Responses

Posted by: Sabarimahesh on: 5/31/2012 [Member] Bronze | Points: 25

Up
0
Down
http://forums.asp.net/t/1791833.aspx/1

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

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

Posted by: Sakthi.Singaravel on: 5/31/2012 [Member] Silver | Points: 25

Up
0
Down
use session variables properly

Regards,
Singaravel M

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

Login to post response