passing parameter to javascript function

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top