how to check does the asp. net control element exist or not? My page actually don't have the element with ID "hyper", but i just want to verify the existence of this.
im looking for the asp.net element with ID "hyper".
so what i have tried is
if (("#<%=hyper.ClientID %>").exists())
or
if (("#<%=hyper.ClientID %>").length>0)
but it give me this error
The name 'hyper' does not exist in the current context
<script type="text/javascript">
function getElement() {
if ($('#<%=(hyper.ClientID)%>').length > 0) {
alert("none!");
}
else
alert("exist!");
}
</script>
<asp:HyperLink ID="hyper2" runat="server" NavigateUrl="www.facebook.com" >click me</asp:HyperLink>
hyper2and your code is looking forhyper