0

hai to all


how to display the message box in asp .net
why means while i am creating database i want to dispay a message like..


"connection is created" like this

how it is display

please give me the answer

4
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by priyankaa
0

Try to following code and it's insert after your connection string code.

Dim strMessage As String
strMessage = "Connection is Created"
'finishes server processing, returns to client.
Dim strScript As String = "<script language=JavaScript>"
strScript += "alert(""" & strMessage & """);"
strScript += "</script"
If (Not ClientScript.IsStartupScriptRegistered("clientScript")) Then
ClientScript.RegisterClientScriptBlock(Me.GetType(), "clientScript", strScript)
End If

0

HI,
To display a message box in asp.net you must use javascript in your html view of your form.Code is as followes.

In head teg of HTML View of your Web Form write the following code
<head>
<Script language="JavaScript">

function showMsg()
{
alert("Your message Here");
}
</Script>
</head>
To Call this function write the following code in ur Page_Load event code in (C#)

UrControlid.Attribute.Add("OnClick","return showMsg();");

I hope It will work.

0

or u can assign string to label control and show the label control at top of ur web form.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.