开发者

calling javascript function from inside label text's hyperlink

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_s开发者_开发问答ession(fi.Name)'" + ">" + fi.Name + "</a>";

y isnt ths working?

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


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>";


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜