title: Java script alert msg in code behind Asp.net 3.5
body: <p>How to use Java script alert msg in code behind? This message will be display after save the data.</p>
  
  <p>Here is my code,</p>
  
  <pre><code>enter code here
  
   Protected Sub Add_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Add.Click
      'add new class
      Dim DbClassMst = New ClassMst()
      Dim dsClass As DataSet
      Dim status As Integer = 0
      Dim ResourceObject As Object
  
      ' 画面リソース定義
      If SessionCtl.GetSession("RES_LANG").ToString = ResourceBase.LOCALE_JA Then
          ResourceObject = New ResourceJa(SessionCtl.GetSession("RES_LANG"))
      Else
          ResourceObject = New ResourceEn(SessionCtl.GetSession("RES_LANG"))
      End If
  
      If NewClass.Text = "" Then
  
          lblErrMsg.Text = ResourceObject.getMsg(ResourceBase.NEW_CLASS_REG)
          Exit Sub
      Else
          'check to allow unique class
          dsClass = DbClassMst.DisplayClass1(NewClass.Text)
          If Trim(dsClass.Tables(0).Rows.Count &gt; 0) Then
              status = 1
          End If
          If dsClass.Tables(0).Rows.Count &lt; 10 Then
              If status = 0 Then
                  'insert class
                  DbClassMst.InsertClassNew(NewClass.Text, dsClass.Tables(0).Rows.Count + 1)
                  PopulateClassName()
                  NewClass.Text = ""
  
  
                  Dim AlertMsg As String = ""
                  AlertMsg = "&lt;script language='javascript'&gt;alert('Data has been saved');&lt;/script&gt;"
  
                   *********Here I need alert msg.
  
  
  
              Else
                  lblErrMsg.Text = ResourceObject.getMsg(ResourceBase.NEW_CLASS_EXIST)
                  Exit Sub
              End If
  
          Else
              lblErrMsg.Text = ResourceObject.getMsg(ResourceBase.NEW_CLASS_MAX)
          End If
      End If
  
  End Sub
  </code></pre>
  
  <p>but is not working. give me an idea.</p>