server-tags

Why is my onbeforeunload not running now when it was before? Or AJAX failing on second identical command?

This follows on from this question This was working: <body onbeforeunload= "ajaxRequest('UnlockQuery.ashx?QueryID=266&UserID=11631');"> This was created using the following in the aspx page: <body onbeforeunload= "ajaxRequest('UnlockQuery.ashx?QueryID=<%= Session["QueryId"] %>& UserID=<%= Session["UserID"] %>')"> This is not wo...

<%# server tags in jquery

Hello all, I am very new to jQuery and have got a quick question. I wish to use my server side classes in my jQuery code, something similar to this: $(document).ready(function() { var temp = <%# myClass.Id %>; }) Is this possible? if so, how? Thank you very much This is the later question I refined my former question to: I'm sorr...

Accessing Server Tags inside Javascript in MVC project

I'd like to use some server tags inside a Javascript function: <%=Model.HtmlProperty%> In the past I have stored this value in a hidden input field, but when a property contains HTML you get problems with special characters such as quotes. I would like to avoid having to encode and decode in the controller to avoid problems with spec...

ServerTags don't work in OnClientClick

<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> Server tags don't work here. I spend a 1-2 hours to find some way to make this work, but i didn't...

How to avoid Adding runat="server" destroying my server tags <%...%>

Adding runat="server" is not rendering my server tags <%...%> I have a masterpage with a few <li> for menu and since I have to set class=selected for the current page, I am using a little server tag to find the url and assign the particular class. I have total of 10 <li> and not all menu is available to all types of user, I need to t...