Hi,
I tried to add some ASP codes to a javascript function by using <% %>, but the problem is I found those lines of ASP I added would be executed anyway, even the javascript function is not fired up. I guess before transferring the page to the browser on client side, the server reads and executes every line of ASP code of the page. So when it encounters a line starting with <%, it simply assumes this line of code is server side and executes it, no matter whether or not it's in a javascript function (ASP server side doesn't recognize javascirpt, so it just ignores it?). Here I have a very simple example of what I mean:
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
DoButton.Attributes.Add("onclick", "javascript:dosomething()");
}
</ Go to the complete details ...