471,605 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

A pop up window from a C# code behind

I'm a little surprised. I tried to search for a way to open a modal dialog
using c# in a code behind file but couldn't really find it. I know there is a
way to do it, but I guess I'm still struggling learning the help system.

Here is the deal. I am writing web based front ends. I'm right now writing
my error handler. It's designed to be quite powerful but for now all I want
to do is pop up a modal window to which I can pass an error message. That's
all.

Could someone point me in the right direction please?
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus
Dec 6 '05 #1
1 2653
Hi,

you cannot do that from the code behind, that code is executed 100% in the
server, not in the client.
what you can do is send the code to the client to do so, define a JScript
function that open the windows as you want it and simply put the code to
call this method, there are several ways of doung it , like:

<scrupt>
function Callme( msg)
{
alert( msg );
}
</script>
<body runat=server id=theBody>

in the code behind

HtmlGenericControl theBody;

if ( somecondition)
theBody.AddAttribute( "onclick", "Callme('some error msg');");

}

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Rik Brooks" <rb*****@hhcc.com.donotspam> wrote in message
news:B1**********************************@microsof t.com...
I'm a little surprised. I tried to search for a way to open a modal dialog
using c# in a code behind file but couldn't really find it. I know there
is a
way to do it, but I guess I'm still struggling learning the help system.

Here is the deal. I am writing web based front ends. I'm right now writing
my error handler. It's designed to be quite powerful but for now all I
want
to do is pop up a modal window to which I can pass an error message.
That's
all.

Could someone point me in the right direction please?
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus

Dec 6 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by HarveyB | last post: by
14 posts views Thread by D. Alvarado | last post: by
2 posts views Thread by Newbie | last post: by
3 posts views Thread by Nevyn Twyll | last post: by
5 posts views Thread by Nazir | last post: by
5 posts views Thread by Mark | last post: by
2 posts views Thread by Chris | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.