Saturday, July 17, 2004 - Posts

What features does ASP.NET still need after Whidbey?

IMHO
workflow engine
web based job scheduler(DTS)
easier handling of stored procedures
better SQL injection/cross site scripting pretenction/prevention

Will Monad be a popular dev env?

Will Monad be a popular application development environment like the Unix shell(s)??
Will Monad be use in client server batch and remoting application development scenarios like SSH?

ASP.NET popup user notification with JS alert, popup, custom label

since I hate the front-end GUI stuff part of web development I always had issues of how to
inform users of particular events. Tired of this, I whipped up a small class to handle these user notifications

here's the code:

Namespace DemDiagnostic

' opens new window with defined error message

Public Class DemErrorNotification

' tytpes of user error notification

Public Enum DisplayType

ALERT ' javascript alert

DISPLAY ' put on errorLabel

POPUP ' pop up

End Enum

' check type of notification and proceed accordingly

Sub notifyError(ByVal curpage As System.Web.UI.Page, ByVal DisplayType As String, ByVal MsgStr As String)

Select Case DisplayType

Case DemErrorNotification.DisplayType.ALERT

displayOnAlert(MsgStr)

Case DemErrorNotification.DisplayType.DISPLAY

displayOnLabel(curpage, MsgStr)

Case DemErrorNotification.DisplayType.POPUP

displayOnNewPage(MsgStr)

Case Else

End Select

End Sub

' popup alert message with ok button

Sub display(ByVal message As String)

HttpContext.Current.Response.Write(" ")

Dim writestring As String

writestring = "myWindow = window.open('','tinyWindow','width=400,height=400,toolbar=no,directories=no');" & " myWindow.document.write(' " & message + "');" & "myWindow.document.bgColor='red';" & " myWindow.document.write('


');" & "myWindow.document.write('');"

HttpContext.Current.Response.Write(writestring)

HttpContext.Current.Response.Write(" ")

End Sub

' puts message on errorLabel component of Page

Function displayOnLabel(ByVal curpage As System.Web.UI.Page, ByVal message As String)

Dim errorlbl As DemWeb.DemUI.DemWebControls.DemErrorLabel

errorlbl = CType(curpage, System.Web.UI.Page).FindControl("ErrorLabel")

errorlbl.addMsg(message)

Return message

End Function

' creates new page with message and close button

Sub displayOnNewPage(ByVal message As String)

HttpContext.Current.Response.Write(" ")

Dim writestring As String

writestring = "myWindow = window.open('','tinyWindow','width=400,height=400,toolbar=no,directories=no');" & " myWindow.document.write(' " & message + "');" & "myWindow.document.bgColor='red';" & " myWindow.document.write('


');" & "myWindow.document.write('');"

HttpContext.Current.Response.Write(writestring)

HttpContext.Current.Response.Write(" ")

End Sub

' writes a javascript alert

Sub displayOnAlert(ByVal MsgStr As String)

HttpContext.Current.Response.Write(" alert('" & MsgStr & "') ")

End Sub

End Class

End Namespace


 

 

some ASP.NET popup links:

http://weblogs.asp.net/miked/archive/2004/02/11/71506.aspx
http://www.mblog.com/lakshmi/046073.html
http://www.dotnetjohn.com/articles/articleid112.aspx
http://weblogs.asp.net/jgalloway/archive/2003/11/21/39042.aspx
http://dotnetjunkies.com/WebLog/jmeeker/archive/2003/12/01/4122.aspx
http://weblogs.asp.net/sonukapoor/archive/2004/05/02/124777.aspx
http://davidhayden.com/blog/dave/archive/2004/03/16/178.aspx
http://dotnetjunkies.com/WebLog/whoiskb/archive/2004/06/01/14899.aspx
http://www.tanguay.info/superblog/sb.aspx?p=codeExamples&id=7846009
http://weblogs.asp.net/kwarren/archive/2004/04/16/114380.aspx