hello,
on checkbox change event i assign value to image from javascript but i notice when i click linkbutton on post back value assign through javascript to image3.imageurl is lost how to retain values assign through javascript to image retain on linkbutton click event
<label class="switch pull-left">
<input type="checkbox" checked runat="server" id="myCheck1" onclick="ShowHideDiv(this)">
<span class="slider round"></span>
</label>
Sort by business </h5>
<h5 >
<label class="switch pull-left">
<input type="checkbox" runat="server" id="myCheck2" onclick="ShowHideDiv1(this)">
<span class="slider round"></span>
</label>
Sort by name
<script type="text/javascript">
function ShowHideDiv() {
if (document.getElementById('<%=myCheck1.ClientID%>').checked == true) {
document.getElementById('<%=myCheck2.ClientID%>').checked = false;
document.getElementById('<%=myCheck1.ClientID%>').checked == true;
document.getElementById('<%=Image3.ClientID%>').src = "/images/a-z.png";
}
}
function ShowHideDiv1() {
if (document.getElementById('<%=myCheck2.ClientID%>').checked == true) {
document.getElementById('<%=myCheck1.ClientID%>').checked = false;
document.getElementById('<%=myCheck2.ClientID%>').checked == true;
document.getElementById('<%=Image3.ClientID%>').src = "/images/1-9.png";
}
}
</script>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="btn-xs btn btn-default pull-right" OnClick="LinkButton1_Click">
<asp:Image ID="Image3" runat="server" ImageUrl="~/images/a-z.png" Width="30px" Height="32px" />
</asp:LinkButton>