javascript and c#

  • Thread starter Thread starter Ralph Soons
  • Start date Start date
R

Ralph Soons

Hi all,

I have a problem with calling a function from a javascript in a aspx file

var refresh = "<%#CheckRefreshRequired()%>";

The first time this line is loaded, the refresh variable is filled with the
return value of the function.
When the page is loaded for the second time, the function isn't called any
more.

Does anyone have any idea why this happens?

Thanks for your help.

Ralph Soons
 
"<%#" means that your function will be evaluated only when you call the
DataBind() method on the page (or control).

Try calling DataBind() also when the page is loaded for the second time, or
replace "<%#" with "<%=" if possible.
 
Back
Top