<asp:button runat="server" Text="Save as" OnClick="btnSave_click"
OnClientClick="if(!Check('<% # tb.ClientID %>')) return false; return Object();"
CausesValidation="false"></asp:button>
<asp:TextBox runat="server" ID="tb"></asp:TextBox>
It's been quite a challenge trying to get server tags to work in this scenario. I've spent a good 1-2 hours exploring different approaches, but nothing seems to be working.
Server tags can be used in:
<OnClientClick="JSFunc();"
<script type="text/javascript">
function JSFunc()
{
var el = document.getElementById('<% # tb.ClientID %>');
//some actions with el here
}
</script>
or in some other cases using C#.
Is there really no way to make server tags work inline? (like in the first example)
PS. Please excuse any errors in my English