passing parameter to javascript function

  • Thread starter Thread starter alf
  • Start date Start date
A

alf

Hi, how can I pass a value from ASP.NET to a javascript function in the
client-side ?? my problem is appening the ' at beginin and end of the
argument:
href=<%# "javascript:myFunction(" +
HttpUtility.UrlEncode(DataBinder.Eval(Container.DataItem,"id").ToString()) +
")" %>

the previous line will generate:
href=javascrip:myFunction(25)

but the real call to a function should be:
href=javascrip:myFunction('25')

and every time that I try to concat + "'" + in the asp.net code I get an
error saying that the instruction is not well formed..

thanks for any help
 
Back
Top