Friday, February 24, 2012

custom code and messagebox popup

Hi at all,
I have custom code written the to show a message Box.
It was working fine in DotNet2005 Development enviroment preview tab.
But it is't working when i deploy this report to the web.
Please use a reference to
System.Windows.Forms, Version=2.0.0.0
Public Function Test() As String
System.Windows.Forms.MessageBox.Show("Hello")
' Or
Msgbox "Hello2"
Return "OK"
End Function
Can anyone help me
martinYou can't use System.Windows.Forms for a web page. Please see the following
URL: http://www.freevbcode.com/ShowCode.asp?ID=5918. If you don't want to
go there, use the following function to stream out a message box
Public Sub ASPNET_MsgBox(ByVal Message As String)
System.Web.HttpContext.Current.Response.Write("<SCRIPT
LANGUAGE=""JavaScript"">" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("alert(""" & Message &
""")" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("</SCRIPT>")
End Sub
--
================Living proof that 95% of programmers are idiots.
"Martin Jau" wrote:
> Hi at all,
> I have custom code written the to show a message Box.
> It was working fine in DotNet2005 Development enviroment preview tab.
> But it is't working when i deploy this report to the web.
> Please use a reference to
> System.Windows.Forms, Version=2.0.0.0
> Public Function Test() As String
> System.Windows.Forms.MessageBox.Show("Hello")
> ' Or
> Msgbox "Hello2"
> Return "OK"
> End Function
> Can anyone help me
> martin
>
>

No comments:

Post a Comment