RegisterStartupScript problem

Results 1 to 2 of 2

Thread: RegisterStartupScript problem

  1. #1
    Join Date
    Dec 1969

    Default RegisterStartupScript problem

    I am trying to trigger a Javascript ,its not getting triggered.<BR>can u please tell me the problem with my code....<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR> &#039;Put user code to initialize the page here<BR> Dim str As String<BR> str = "&#060;script language=javascript id=&#039;Startup&#039;&#062; {alert(&#039;mahesh&#039;);}&#060;/script&#062;"<BR> RegisterStartupScript("Startup", str)<BR> End Sub

  2. #2
    Join Date
    Dec 1969

    Default RE: RegisterStartupScript problem

    I&#039;m not 100% sure but try breaking up the closing script block into two strings<BR><BR>Quote from SM (<BR>"closing script must be broken up into two strings (i.e., "&#060;" & "/script&#062;"). If it is not, the ASP.NET parsing engine will be confused when it reaches that closing script block and generate an error."<BR><BR>Hope that helps.<BR><BR>Tim

Posting Permissions

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