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

  • Thread starter Thread starter al
  • Start date Start date
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
 
Back
Top