A
Ajay Desh
Hi
I am gettin error, if i try to find the top position of a table.
Here is what i am doing.I have a HtmlTable (Table3 is the name/id)
created.It has a position and a Top and Left co-ordinates assigned. I
have a button to add a row to this table. When i click on this button
the code behind is :
private void add_ServerClick(object sender, System.EventArgs e)
{
// Generate rows and cells.
HtmlTable objcheck = (HtmlTable)Page.FindControl("Table3");
string newtr=objcheck.Style["Top"].ToString();
}
Now i want to know the position of the Table3 ie the Top position. And
when i Response.write objcheck it is giving me correct output saying
Htmltable control is created , but in this line :
string newtr=objcheck.Style["Top"].ToString();
Its giving me an exception :
System.NullReferenceException: Object reference not set to an instance
of an object.
I am not sure if am doing it right. I am sure the table3 is exists and
am also Finding the control , i dunno why its still giving me the error
at that Line . Your inputs will be of great help.
Thanks
Ajay
I am gettin error, if i try to find the top position of a table.
Here is what i am doing.I have a HtmlTable (Table3 is the name/id)
created.It has a position and a Top and Left co-ordinates assigned. I
have a button to add a row to this table. When i click on this button
the code behind is :
private void add_ServerClick(object sender, System.EventArgs e)
{
// Generate rows and cells.
HtmlTable objcheck = (HtmlTable)Page.FindControl("Table3");
string newtr=objcheck.Style["Top"].ToString();
}
Now i want to know the position of the Table3 ie the Top position. And
when i Response.write objcheck it is giving me correct output saying
Htmltable control is created , but in this line :
string newtr=objcheck.Style["Top"].ToString();
Its giving me an exception :
System.NullReferenceException: Object reference not set to an instance
of an object.
I am not sure if am doing it right. I am sure the table3 is exists and
am also Finding the control , i dunno why its still giving me the error
at that Line . Your inputs will be of great help.
Thanks
Ajay