This blog is about the dotnet.all types of codes,news about dotnet including asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.ncluding asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.asp.net programming,dot net programming,dotnet programs,dotnet source code,source code.

Free Hosting

Free Hosting

Sunday, January 4, 2009

ASP.Net source code for Msgbox

Version: ASP.NET 1.1
Compatibility: ASP.NET 1.1
Category: ASP.NET


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

0 comments:

dotnet(.Net) Project Source code Downloads and Tutorials

Email Subscrption



Enter your email address:

Delivered by FeedBurner

Feedburner Count

Blog Archive

Unique Visitor

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger