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
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
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
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.
or u can assign string to label control and show the label control at top of ur web form.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.