views:

41

answers:

1

My Question is related to access the rows in one page and putting conditions in another page.

I need to check whether a datagrid has row in it or not. DataGrid is in .aspx page. Based on this checking i need to write a condition in .ascx page.

the .ascx on which condition is checked is linked to .aspx page. Meaning that UserControl1.ascx is Register with Default.aspx page

I am using VS 2003

Please advice

Thanks

A: 

How about adding an flag in Session? For instance, when you render the grid over aspx, get the number of rows, MyDataTable.Rows.Count and add into the session, like Session["MyDataTable.Rows.Count"] = MyDataTable.Rows.Count; from the ascx, check the value in session, and let your app make a decision based upon that value.

KMan
thanks for instant solution..!!! i would try this..
Romil Nagrani
where should i write DataGrid.Rows.count? In some event like item command or in databind method?
Romil Nagrani
Will your code work in VS 2003?
Romil Nagrani