Javascript in code behind does not work..Please help?

A

al

Greetings,

I have this javascript code in ASP.NET code behind:


Dim str1 as string ="test"

Private Sub Page_Load(byval sender as system.Obeject, byval e as
system.eventargs)handles mybase.load


Div1.attributes.add("onclick","alert(" & str1 & ")")

End Sub

when page loades and I click Div1, javascript error occurs saying:

"test" is undefined???

MTIA,
Grawsha
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top