tags:

views:

84

answers:

3

i am calling a function which is inside Homescroll.ascx.cs from Homescroll.ascx

so i wrote on Homescroll.ascx as <% Response.Write(scroll()); %>

but all this is in update panel,and i am getting errors. so is their any other way to call function from homescroll.ascx to homescroll.ascx.cs,instead of response.write();

+1  A: 

How about using syntax - <%= scroll() %>?

VinayC
<%= is just shorthand for Response.Write anyway, and unlikely to solve the problem if R.W doesn't work.
annakata
A: 

Need more information but I would assume scroll would be a client function just by its name and you should use a scriptmanager like this:

ScriptManager.RegisterClientScriptBlock(this,typeof(Page),"scrollScript","scroll();",true);

see http://msdn.microsoft.com/en-us/library/bb350750.aspx for more info. If you don;t want to call it from the code behind there is no need for the <% %> or the respoonse.write at all. Just wrap it in a script tag with the type set to text/javascript.

Mike
+2  A: 
Michael Kropat