views:

60

answers:

2

i need to call the javascript function make_session hen the hyperlink inside the label's text is clicked upon. this is the code is used:

Label1.Text += "<br><a href='next1.aspx' onclick='make_session(fi.Name)'" + ">" + fi.Name + "</a>";

y isnt ths working?

there is no syntax error but the javascript function make_session never gets called.

A: 

Just a wild guess... we would need more code examples to determine the problem...

Label1.Text += "<br><a href='next1.aspx' onclick='make_session(\"" + fi.Name + "\")'" + ">" + fi.Name + "</a>";
ApoY2k
A: 

Looking at the code you've posted, it appears that you're attempting to call the make_session method with a variable that exists only server side. In this context fi.Name only lives within the code behind. JavaScript has no idea what this variable is. More likely your function is getting called, but an error is being generated that you are not seeing.

Joel Etherton