From: MWulfe on
In fact I did end up using the in-line javascript and it works just fine.
The only minor drawbacks are that the screen goes blank on some systems but
only while the message is displayed, there is no flexibility is the dialog
title, the text in the message cannot really be formated, and there is
always a "beep" when the message is displayed. Still, it is a relatively
simple solution and it works consistently.

"Alexey Smirnov" <alexey.smirnov(a)gmail.com> wrote in message
news:8d028127-e652-4659-9f9f-b909154b243b(a)r34g2000yqj.googlegroups.com...
On Apr 30, 9:40 am, "Andy B." <a_bo...(a)sbcglobal.net> wrote:
> "Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>
> news:dee1feb1-764e-4470-90b1-28c9684ee860(a)o14g2000yqb.googlegroups.com...
> On Apr 30, 1:56 am, MWulfe <mwu...(a)yahoo.com> wrote:
>
> > I want to use javascript to do the equivalent to this Windows Form
> > code on an asp.net webpage using VB:
>
> > if x = 2 and y = 3 then
> > messagebox.show("This is a message")
> > end if
>
> > Many of the code I've found appears to be obsolete or includes lots of
> > other bells and whistles (adding an alert to a datagrid or a control
> > attribute), which I do not need and only find confusing. I'm using
> > Web Developer Express 2008.
>
> > Help would be appreciated! Thanks!
>
> if (x==2 && y==3)
> alert("message");
>
> How do you do that from the vb codebehind?

Sure, it's inline javascript. I think, he didn't mention that it must
be from the codebehind.

In addition to example by Mark, this can be done using public
variables as

vb.net
-----------------
Protected Dim x As Integer = 2
Protected Dim y As Integer = 3
-----------------

aspx
-----------------
if (<%=x%>==2 && <%=y%>==3)
alert("message");
-----------------

I think it should work as expected.

From: Alexey Smirnov on
On May 5, 6:20 pm, "MWulfe" <mwu...(a)yahoo.com> wrote:
> In fact I did end up using the in-line javascript and it works just fine.
> The only minor drawbacks are that the screen goes blank on some systems but
> only while the message is displayed, there is no flexibility is the dialog
> title, the text in the message cannot really be formated, and there is
> always a "beep" when the message is displayed.  Still, it is a relatively
> simple solution and it works consistently.
>

You can think about using Web2.0/ASP.NET way by implementing
ModalPopupExtender. The ModalPopup extender allows to display a free
designed "popup" in a similar manner which prevents the user from
interacting with the rest of the page. The popup can be shown via
server in code behind and on the client in script. It can be designed
in any way and you can have any title and no beep would occurred. This
would not require any big changes in code, but in application
configuration (you would need to download and include
AjaxControlToolkit and setup it in the web.config file. More about
ModalPopupExtender and AjaxControlToolkit you can find here

http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx

Cheers!