473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Message Boxes to Browser for Code Behind

I am developing a web application using aspx web forms and
would like to send message boxes to the client browser
when certain conditions and checks are performed.

************************************************** *******
Example:

Try

Perform some actions

Catch ex as system.exception ' Actions failed

I would like to send the error to the screen in the form
of a messagebox on the client browser

End try

************************************************** ******

Additionally, I would like to be able to prompt a
messagebox to ask questions and then process based on the
response. Similar to do you want to delete all the records
selected prompt on a yes choice then delete the records on
a no choice cancel.

All of my server code is in the Code Behind pages for each
of my aspx pages. Basically all the display is in the aspx
and all the code is in the code behind.

Any help would be greatly appreciated, especially any
sample code examples. This is my first application using
aspx. I have been writing windows apps and windows
services, but the web provides for some additional
challenges.

Troy Whitlow

Nov 18 '05 #1
7 1896
Nope....
You can only do this by stopping all processing, sending everythign to the
client and waiting for another post-back/round-trip to the server for the
next step....
All the server processing is done before the client gets it's chance to
interact

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Troy Whitlow" <tr**********@hp.com> wrote in message
news:01****************************@phx.gbl...
I am developing a web application using aspx web forms and
would like to send message boxes to the client browser
when certain conditions and checks are performed.

************************************************** *******
Example:

Try

Perform some actions

Catch ex as system.exception ' Actions failed

I would like to send the error to the screen in the form
of a messagebox on the client browser

End try

************************************************** ******

Additionally, I would like to be able to prompt a
messagebox to ask questions and then process based on the
response. Similar to do you want to delete all the records
selected prompt on a yes choice then delete the records on
a no choice cancel.

All of my server code is in the Code Behind pages for each
of my aspx pages. Basically all the display is in the aspx
and all the code is in the code behind.

Any help would be greatly appreciated, especially any
sample code examples. This is my first application using
aspx. I have been writing windows apps and windows
services, but the web provides for some additional
challenges.

Troy Whitlow

Nov 18 '05 #2
Execute a line of code like this when you want a message box to be
displayed.
(This writes out the necessary client side javascript to your HTML page to
make the alert pop up as soon as the page is sent to their browser.)

RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");

Here's more info:
http://msdn.microsoft.com/library/de...criptTopic.asp

Here are a couple controls you might find to be useful:
http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
http://www.jttz.com/msgbox/index.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Troy Whitlow" <tr**********@hp.com> wrote in message
news:01****************************@phx.gbl...
I am developing a web application using aspx web forms and
would like to send message boxes to the client browser
when certain conditions and checks are performed.

************************************************** *******
Example:

Try

Perform some actions

Catch ex as system.exception ' Actions failed

I would like to send the error to the screen in the form
of a messagebox on the client browser

End try

************************************************** ******

Additionally, I would like to be able to prompt a
messagebox to ask questions and then process based on the
response. Similar to do you want to delete all the records
selected prompt on a yes choice then delete the records on
a no choice cancel.

All of my server code is in the Code Behind pages for each
of my aspx pages. Basically all the display is in the aspx
and all the code is in the code behind.

Any help would be greatly appreciated, especially any
sample code examples. This is my first application using
aspx. I have been writing windows apps and windows
services, but the web provides for some additional
challenges.

Troy Whitlow

Nov 18 '05 #3
Does this get sent prior to the rest of the serverside code processing
though? If it does that would be kewl....but I didn't think it did?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Ol**************@TK2MSFTNGP11.phx.gbl...
Execute a line of code like this when you want a message box to be
displayed.
(This writes out the necessary client side javascript to your HTML page to
make the alert pop up as soon as the page is sent to their browser.)

RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");

Here's more info:
http://msdn.microsoft.com/library/de...criptTopic.asp
Here are a couple controls you might find to be useful:
http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
http://www.jttz.com/msgbox/index.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Troy Whitlow" <tr**********@hp.com> wrote in message
news:01****************************@phx.gbl...
I am developing a web application using aspx web forms and
would like to send message boxes to the client browser
when certain conditions and checks are performed.

************************************************** *******
Example:

Try

Perform some actions

Catch ex as system.exception ' Actions failed

I would like to send the error to the screen in the form
of a messagebox on the client browser

End try

************************************************** ******

Additionally, I would like to be able to prompt a
messagebox to ask questions and then process based on the
response. Similar to do you want to delete all the records
selected prompt on a yes choice then delete the records on
a no choice cancel.

All of my server code is in the Code Behind pages for each
of my aspx pages. Basically all the display is in the aspx
and all the code is in the code behind.

Any help would be greatly appreciated, especially any
sample code examples. This is my first application using
aspx. I have been writing windows apps and windows
services, but the web provides for some additional
challenges.

Troy Whitlow


Nov 18 '05 #4
No, normally this gets sent along to the client along with all the other
server generated HTML & script after all the serverside code processing is
complete. Although you should be able to use Response.Write to send the
javascript out immediately if this is what you want - as long as you turn
buffering off.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Does this get sent prior to the rest of the serverside code processing
though? If it does that would be kewl....but I didn't think it did?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Ol**************@TK2MSFTNGP11.phx.gbl...
Execute a line of code like this when you want a message box to be
displayed.
(This writes out the necessary client side javascript to your HTML page to make the alert pop up as soon as the page is sent to their browser.)

RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");

Here's more info:

http://msdn.microsoft.com/library/de...criptTopic.asp

Here are a couple controls you might find to be useful:
http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
http://www.jttz.com/msgbox/index.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Troy Whitlow" <tr**********@hp.com> wrote in message
news:01****************************@phx.gbl...
I am developing a web application using aspx web forms and
would like to send message boxes to the client browser
when certain conditions and checks are performed.

************************************************** *******
Example:

Try

Perform some actions

Catch ex as system.exception ' Actions failed

I would like to send the error to the screen in the form
of a messagebox on the client browser

End try

************************************************** ******

Additionally, I would like to be able to prompt a
messagebox to ask questions and then process based on the
response. Similar to do you want to delete all the records
selected prompt on a yes choice then delete the records on
a no choice cancel.

All of my server code is in the Code Behind pages for each
of my aspx pages. Basically all the display is in the aspx
and all the code is in the code behind.

Any help would be greatly appreciated, especially any
sample code examples. This is my first application using
aspx. I have been writing windows apps and windows
services, but the web provides for some additional
challenges.

Troy Whitlow



Nov 18 '05 #5
Still need the Response.Flush() calls like in classic ASP?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
No, normally this gets sent along to the client along with all the other
server generated HTML & script after all the serverside code processing is
complete. Although you should be able to use Response.Write to send the
javascript out immediately if this is what you want - as long as you turn
buffering off.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Does this get sent prior to the rest of the serverside code processing
though? If it does that would be kewl....but I didn't think it did?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Ol**************@TK2MSFTNGP11.phx.gbl...
Execute a line of code like this when you want a message box to be
displayed.
(This writes out the necessary client side javascript to your HTML page
to
make the alert pop up as soon as the page is sent to their browser.)

RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");

Here's more info:

http://msdn.microsoft.com/library/de...criptTopic.asp
Here are a couple controls you might find to be useful:
http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
http://www.jttz.com/msgbox/index.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Troy Whitlow" <tr**********@hp.com> wrote in message
news:01****************************@phx.gbl...
> I am developing a web application using aspx web forms and
> would like to send message boxes to the client browser
> when certain conditions and checks are performed.
>
> ************************************************** *******
> Example:
>
> Try
>
> Perform some actions
>
> Catch ex as system.exception ' Actions failed
>
> I would like to send the error to the screen in the form
> of a messagebox on the client browser
>
> End try
>
> ************************************************** ******
>
> Additionally, I would like to be able to prompt a
> messagebox to ask questions and then process based on the
> response. Similar to do you want to delete all the records
> selected prompt on a yes choice then delete the records on
> a no choice cancel.
>
> All of my server code is in the Code Behind pages for each
> of my aspx pages. Basically all the display is in the aspx
> and all the code is in the code behind.
>
> Any help would be greatly appreciated, especially any
> sample code examples. This is my first application using
> aspx. I have been writing windows apps and windows
> services, but the web provides for some additional
> challenges.
>
> Troy Whitlow
>



Nov 18 '05 #6
Not sure off the top of my head, but it would be easy enough to test.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
Still need the Response.Flush() calls like in classic ASP?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
No, normally this gets sent along to the client along with all the other
server generated HTML & script after all the serverside code processing is
complete. Although you should be able to use Response.Write to send the
javascript out immediately if this is what you want - as long as you turn buffering off.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Does this get sent prior to the rest of the serverside code processing
though? If it does that would be kewl....but I didn't think it did?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Ol**************@TK2MSFTNGP11.phx.gbl...
> Execute a line of code like this when you want a message box to be
> displayed.
> (This writes out the necessary client side javascript to your HTML

page
to
> make the alert pop up as soon as the page is sent to their browser.)
>
> RegisterStartupScript("startupScript", "<script
> language=JavaScript>alert('This is my message.');</script>");
>
> Here's more info:
>

http://msdn.microsoft.com/library/de...criptTopic.asp
>
> Here are a couple controls you might find to be useful:
> http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
> http://www.jttz.com/msgbox/index.htm
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
> Hire top-notch developers at http://www.able-consulting.com
>
>
>
> "Troy Whitlow" <tr**********@hp.com> wrote in message
> news:01****************************@phx.gbl...
> > I am developing a web application using aspx web forms and
> > would like to send message boxes to the client browser
> > when certain conditions and checks are performed.
> >
> > ************************************************** *******
> > Example:
> >
> > Try
> >
> > Perform some actions
> >
> > Catch ex as system.exception ' Actions failed
> >
> > I would like to send the error to the screen in the form
> > of a messagebox on the client browser
> >
> > End try
> >
> > ************************************************** ******
> >
> > Additionally, I would like to be able to prompt a
> > messagebox to ask questions and then process based on the
> > response. Similar to do you want to delete all the records
> > selected prompt on a yes choice then delete the records on
> > a no choice cancel.
> >
> > All of my server code is in the Code Behind pages for each
> > of my aspx pages. Basically all the display is in the aspx
> > and all the code is in the code behind.
> >
> > Any help would be greatly appreciated, especially any
> > sample code examples. This is my first application using
> > aspx. I have been writing windows apps and windows
> > services, but the web provides for some additional
> > challenges.
> >
> > Troy Whitlow
> >
>
>



Nov 18 '05 #7
you can use my free control 'ControlHelper' to popup
Alert,Confirm,Prompt,Dialog !

http://www.lostinet.com/en/lwsamplecs/

you can download it and use it for free .

I think you will be shocked after you know you needn't write javascript code
any more

--
http://www.lostinet.com/
---------------------------
Lostinet.Web Controls&Components help you to build better Asp.Net
CustomerControl&UserControl&Application.
---------------------------
It's FREE !!
---------------------------
ControlHelper&HelperElement for MessageBox&Dialog
ComboBox,ComboCalendar,SmartIframe
---------------------------
Remote Asp.Net Execution

"Troy Whitlow" <tr**********@hp.com> ????
news:01****************************@phx.gbl...
I am developing a web application using aspx web forms and
would like to send message boxes to the client browser
when certain conditions and checks are performed.

************************************************** *******
Example:

Try

Perform some actions

Catch ex as system.exception ' Actions failed

I would like to send the error to the screen in the form
of a messagebox on the client browser

End try

************************************************** ******

Additionally, I would like to be able to prompt a
messagebox to ask questions and then process based on the
response. Similar to do you want to delete all the records
selected prompt on a yes choice then delete the records on
a no choice cancel.

All of my server code is in the Code Behind pages for each
of my aspx pages. Basically all the display is in the aspx
and all the code is in the code behind.

Any help would be greatly appreciated, especially any
sample code examples. This is my first application using
aspx. I have been writing windows apps and windows
services, but the web provides for some additional
challenges.

Troy Whitlow

Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: mr_burns | last post by:
hi, is it possible to change the contents of a combo box when the contents of another are changed. for example, if i had a combo box called garments containing shirts, trousers and hats, when...
9
by: Coleen | last post by:
I'm using MS .Net Version 7, using VB .Net working on a "simple" web page. All I want to do is display a messagebox. I tried using Messagebox.Show, and get an error that Messagebox has not been...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
2
by: louissan | last post by:
Hi all, I have a slight problem with IE, when everything works with firefox. The goal is to _create_ boxes using the createElement method. And then making it draggable with the mouse. The code...
12
by: jburkle | last post by:
Hello all, I am still having an issue where multiple Message Boxes are being displayed to the user from the same form at one time. This issue hides the boxes behind the forms since the forms take...
13
by: Kevin Liebowicz | last post by:
Yes, I wasted the past two days trying to fix this. Yes, this is on a Win2003 Server. Yes, this machine is a domain controller. Yes, I seen the dozens of KB articles like this one:...
8
ADezii
by: ADezii | last post by:
Have you ever wondered how Microsoft Access displays those Custom Message Boxes with the first line in BOLD, and the second and/or second and third lines in Normal Font Weight? The answer lies in the...
3
by: =?Utf-8?B?R3JlZw==?= | last post by:
Is there an equivelant message box (such as in a Windows Application) I can use for a Web Application? I've found some examples of JavaScript message boxes, but I would rather use something that's...
11
by: Patrick | last post by:
Trying this question again in a different way and expanding it to another newsgroup. Looking for how I would do this. For an html form; Say I have three check boxes A, B, and C . When I click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.