Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Get Html element from from to user control

$
0
0

I have a web form with multiple User control.

I have a save button inside a user control when user press save button i want to cange the style of <li> that is inside a form

webform.aspx

</head><body><form id="form1" runat="server"><ul><li runat="server" ID="li1" style="">01. Step 1 </li><li runat="server" ID="li2">02. Step 2 </li><li runat="server" ID="li3">03. Step 3 </li><li runat="server" ID="li4">04. Step 4 </li><li runat="server" ID="li5">05. Step 5</li></ul><div id="left2"><uc7:Step1 ID="Step1" runat="server" /></div><div id="left2"><uc7:Step1 ID="Step2" runat="server" /></div><div id="left2"><uc7:Step1 ID="Step3" runat="server" /></div><div id="left2"><uc7:Step1 ID="Step4" runat="server" /></div></form></body>

//-------------------------------Inside User Control Step-------------------------

<asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/save.png"    onclick="btnSave_Click1" />

in code behind

 HtmlGenericControl li1 = new HtmlGenericControl("li");
                li1.ID = "li1";
                li1.Attributes.Add("style", "background:url(../Images/buttons.png); background-repeat:no-repeat;");

HtmlGenericControl li2 = new HtmlGenericControl("li");
                li2.ID = "l12";
                li2.Attributes.Add("style", "background:url(../Images/active-button-current.png); background-repeat:no-repeat;");


its not changeing the style of list item......


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>