hi ,
u need to get all li element int the page ?????
use this code
public Dictionary<string ,string > _dic { get; set; }
public Dictionary<string, string> dic
{
get
{
if (_dic == null)
{
_dic = new Dictionary<string, string>();
}
return _dic;
}
set
{
_dic = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
Get(this.Controls);
foreach (KeyValuePair<string,string > val in dic )
{
Response.Write(val.Value+"<br/>");
if (1==1)
{
FindControl(val.Value).Visible = true;
}
}
}
protected void Get(ControlCollection conColl)
{
foreach (Control con in conColl)
{
if (con.GetType() == typeof(System.Web.UI.HtmlControls.HtmlGenericControl) && con.Controls[0].GetType() == typeof(LiteralControl))
{
dic[con.ID] = con.ID;
}
else
{
Get(con.Controls);
}
}
}
if u cant access the the element is C# cs code u should
define the name property for the control then u will access it in cs Code .
regards
Abraheem Abulubbad