Click here to Skip to main content
15,911,139 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
XML
<%@ Control Language="VB" AutoEventWireup="true" CodeFile="messagebox.ascx.vb" Inherits="messagebox" %>
<asp:Literal ID="Literal1" runat="server" Text="messagebox"></asp:Literal>


-------------Coding----------------------------
VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       Literal1.Visible = False
       Literal1.Text = ""
   End Sub
   Public Sub show(ByVal msg As String)
       Literal1.Text = "<div style='width=1px;height=1px' onresize=\"this.style.display='none';alert('" + msg + "');\"/>" +
           "<script language='javascript'> alert('" + msg + "');</script>";
   End Sub
Posted

Hi,

Please add the following code in page load event.

If not IsPostBack then
VB
Literal1.Visible = False
      Literal1.Text = ""


End if

Hope it will help you.

Regards,
Kiran.
 
Share this answer
 
I just wrote this it worked for me
MIDL
Literal1.Text="<div style='width=1px;height=1px' onresize=\"this.style.display='none';alert('" + msg + "');\"/>" +
   "<script language='javascript'> alert('" + msg + "');</script>";



Some Problem in your Quotes
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900