Hi all,
i have make a claas to show alert message
Public Sub UserMsgBox(ByVal sMsg As String)
Dim sb As New StringBuilder
Dim oFormObject As System.Web.UI.Control
sMsg = sMsg.Replace("'", "\'")
sMsg = sMsg.Replace(Chr(34), "\" & Chr(34))
sMsg = sMsg.Replace(vbCrLf, "\n")
sMsg = "<script language=javascript>alert(""" & sMsg & """)</script>"
sb = New StringBuilder
sb.Append(sMsg)
For Each oFormObject In Me.Controls
If TypeOf oFormObject Is HtmlForm Then
Exit For
End If
Next
oFormObject.Controls.AddAt(oFormObject.Controls.Count, New LiteralControl(sb.ToString()))
End Sub
Protected Sub btn_show_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_show.Click
UserMsgBox("Hello .....!")
End Sub
working correctly if i am not using Update panel...... but if i take the button into update panel message does not show why? how i can solve it ?
Thanks in advance