.Net equivalent of <%=sMessage%>

Results 1 to 2 of 2

Thread: .Net equivalent of <%=sMessage%>

  1. #1
    Join Date
    Dec 1969

    Default .Net equivalent of <%=sMessage%>

    Hi, <BR>I have a variable declared and want to then alert it in Javascript, so I want to pass the value of the message to the javascript function but error comes out as<BR><BR>Name &#039;sMessage&#039; is not declared<BR><BR>I have the variable declared as <BR><BR>dim sMessage as String = "Test"<BR><BR>and then within the Javascript function I am trying to do<BR><BR>var sMessage = "&#060;%=sMessage)%&#062;"<BR> <BR>if (sMessage != "")<BR>{<BR>alert(sMessage)<BR>}<BR><BR>This would work in ASP, but not .NET it seems<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: .Net equivalent of <%=sMessage%>

    you need to look into RegisterClientScriptBlock for this.<BR><BR><BR>j<BR>http://rtfm.atrax.co.uk/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts