URGENT !! ASP.NET and Javascript !! How to use java script in asp server controls ?

Posted by .Netlearner under ASP.NET on 6/20/2012 | Points: 10 | Views : 965 | Status : [Member] | Replies : 1
Am having a list item (li) for which am assgining the values dynamically.And while the particular item is selected i want that top be highlighted.

i Used Following Code to do this but as am using runat="server" its not applied.if i removed the runat="server" Javascript is working good .But Li is not treated as a server control anymore and its not enabled in the code behind file.So i cant remove the runat="server" attribute also.

How This can be done.

<li id="adminabout"><asp:LinkButton ID="lbtnadminabout3" runat="server" OnClick="OnClick1" CausesValidation="false"></asp:LinkButton></li>
<li id="admingeneral"><asp:LinkButton ID="lbtnadmingeneral" runat="server" CausesValidation="false" OnClick="OnClick2"></asp:LinkButton></li>

<script type="text/javascript">
function select1()
function select2()
function select3()


Posted by: Hitesh.Hirpara on: 6/20/2012 [Member] Starter | Points: 25

Source Co de

<form id="form1" runat="server">
<li id="adminabout" runat="server">
<asp:LinkButton ID="lbtnadminabout3" runat="server" CausesValidation="false"
<li id="admingeneral" runat="server">
<asp:LinkButton ID="lbtnadmingeneral" runat="server" CausesValidation="false"

code beh ind
protected void lbtnadminabout3_Click(object sender, EventArgs e)
adminabout.Attributes.Add("class", "selected");

protected void lbtnadmingeneral_Click(object sender, EventArgs e)
admingeneral.Attributes.Add("class", "selected");

try this

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

Login to post response