Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Msgbox for ASP.Net
Author:
ASPSoft
E-mail:
Click to e-mail author
Website:
http://frasierdvd.com
Submitted:
11/21/2005
Version:
ASP.NET 1.1
Compatibility:
ASP.NET 1.1
Category:
ASP.NET
Views:
87425
Msgbox function for ASP.Net. Call this function from the server side, and a msgbox will appear on the client browser. As a bonus, the msgbox javascript is added after the rest of the form, so the browser displays the html for the page and then the msgbox.
Declarations:
Imports System.Text
Code:
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 = "" sb = New StringBuilder() sb.Append(sMsg) For Each oFormObject In Me.Controls If TypeOf oFormObject Is HtmlForm Then Exit For End If Next ' Add the javascript after the form object so that the ' message doesn't appear on a blank screen. oFormObject.Controls.AddAt(oFormObject.Controls.Count, New LiteralControl(sb.ToString())) end sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement