473,320 Members | 1,853 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,320 software developers and data experts.

About Msg/Alert Boxes in a Web Application

Please see threads on "Dumb question about Message boxes" - I went to the
specified link - this works great if all you want to do is display a message
box before any of your script behind the aspx.vb runs or on the click event,
but if you are actually trying to validate user selections, such as when an
item from a drop-down is selected, I get an error if I put it in this code:

<asp:dropdownlist id="ddl_year" runat="server" Width="40%"
CssClass="datagrid " AutoPostBack="True" OnSelectedIndexChanged="script
language="VBScript"> MsgBox "Hello there" </script>"></asp:dropdownlist>

I get the red-squiggly on ="VBScript" and "Hello There" and of course a
build error when I try to run it. What I really need to do is validate a
selection from the dropdown list box (a date), if it is not the current
date, then I need a msg or alert box to warn the user that their selection
is not current and that the data they will be viewing is not updateable.
Where do I need to put this code to get it to run after a selection has been
made? Any suggestions? Thanks

Coleen
Jul 21 '05 #1
4 1616
Why not use a custom validator control for this? This allows you to write
your own client-side JavaScript (so you can include the native alert()).
And in the corresponding server-side validation, you can push a client-side
script down to the client if need be.
"Coleen" <co**********@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl...
Please see threads on "Dumb question about Message boxes" - I went to the
specified link - this works great if all you want to do is display a message box before any of your script behind the aspx.vb runs or on the click event, but if you are actually trying to validate user selections, such as when an item from a drop-down is selected, I get an error if I put it in this code:
<asp:dropdownlist id="ddl_year" runat="server" Width="40%"
CssClass="datagrid " AutoPostBack="True" OnSelectedIndexChanged="script
language="VBScript"> MsgBox "Hello there" </script>"></asp:dropdownlist>

I get the red-squiggly on ="VBScript" and "Hello There" and of course a
build error when I try to run it. What I really need to do is validate a
selection from the dropdown list box (a date), if it is not the current
date, then I need a msg or alert box to warn the user that their selection
is not current and that the data they will be viewing is not updateable.
Where do I need to put this code to get it to run after a selection has been made? Any suggestions? Thanks

Coleen

Jul 21 '05 #2
The whole point is that I don't know JavaScript!!! I was/am searching for
an alternative to writing JavaScript code to do the validation. The link
that Michael Lang gave looks great, but when I use it in my .aspx code for
the drop down, I get errors. Any suggestions?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Why not use a custom validator control for this? This allows you to write
your own client-side JavaScript (so you can include the native alert()).
And in the corresponding server-side validation, you can push a client-side script down to the client if need be.
"Coleen" <co**********@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl...
Please see threads on "Dumb question about Message boxes" - I went to the specified link - this works great if all you want to do is display a

message
box before any of your script behind the aspx.vb runs or on the click

event,
but if you are actually trying to validate user selections, such as when

an
item from a drop-down is selected, I get an error if I put it in this

code:

<asp:dropdownlist id="ddl_year" runat="server" Width="40%"
CssClass="datagrid " AutoPostBack="True" OnSelectedIndexChanged="script
language="VBScript"> MsgBox "Hello there" </script>"></asp:dropdownlist>

I get the red-squiggly on ="VBScript" and "Hello There" and of course a
build error when I try to run it. What I really need to do is validate a selection from the dropdown list box (a date), if it is not the current
date, then I need a msg or alert box to warn the user that their selection is not current and that the data they will be viewing is not updateable.
Where do I need to put this code to get it to run after a selection has

been
made? Any suggestions? Thanks

Coleen


Jul 21 '05 #3
Yes, my suggestion is the same as before. I'm sorry that you don't want to
use JavaScript, but JavaScript is the only client-side scripting language
that is supported by all mainstream browsers. For this reason, JavaScript
is the defacto client-side scripting standard.

You asked how to accomplish your goal and this is how it is done.
"Coleen" <co**********@yahoo.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
The whole point is that I don't know JavaScript!!! I was/am searching for
an alternative to writing JavaScript code to do the validation. The link
that Michael Lang gave looks great, but when I use it in my .aspx code for
the drop down, I get errors. Any suggestions?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Why not use a custom validator control for this? This allows you to write
your own client-side JavaScript (so you can include the native alert()).
And in the corresponding server-side validation, you can push a client-side
script down to the client if need be.
"Coleen" <co**********@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl...
Please see threads on "Dumb question about Message boxes" - I went to the specified link - this works great if all you want to do is display a

message
box before any of your script behind the aspx.vb runs or on the click

event,
but if you are actually trying to validate user selections, such as when an
item from a drop-down is selected, I get an error if I put it in this

code:

<asp:dropdownlist id="ddl_year" runat="server" Width="40%"
CssClass="datagrid " AutoPostBack="True"
OnSelectedIndexChanged="script language="VBScript"> MsgBox "Hello there" </script>"></asp:dropdownlist>
I get the red-squiggly on ="VBScript" and "Hello There" and of course a build error when I try to run it. What I really need to do is validate a selection from the dropdown list box (a date), if it is not the
current date, then I need a msg or alert box to warn the user that their selection is not current and that the data they will be viewing is not updateable. Where do I need to put this code to get it to run after a selection

has been
made? Any suggestions? Thanks

Coleen



Jul 21 '05 #4
It's not that I don't want to use it...it's that I don't know JavaScript.
This means a learning period, which I was hoping to avoid, since we need to
keep this project on schedule. But, alas, if I have to learn JavaScript, I
have to; I guess it will look good in a resume down the line...Thanks for
your help.
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Yes, my suggestion is the same as before. I'm sorry that you don't want to use JavaScript, but JavaScript is the only client-side scripting language
that is supported by all mainstream browsers. For this reason, JavaScript
is the defacto client-side scripting standard.

You asked how to accomplish your goal and this is how it is done.
"Coleen" <co**********@yahoo.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
The whole point is that I don't know JavaScript!!! I was/am searching for
an alternative to writing JavaScript code to do the validation. The link that Michael Lang gave looks great, but when I use it in my .aspx code for the drop down, I get errors. Any suggestions?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Why not use a custom validator control for this? This allows you to write your own client-side JavaScript (so you can include the native alert()). And in the corresponding server-side validation, you can push a client-side
script down to the client if need be.
"Coleen" <co**********@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl...
> Please see threads on "Dumb question about Message boxes" - I went to the
> specified link - this works great if all you want to do is display a
message
> box before any of your script behind the aspx.vb runs or on the
click event,
> but if you are actually trying to validate user selections, such as

when an
> item from a drop-down is selected, I get an error if I put it in this code:
>
> <asp:dropdownlist id="ddl_year" runat="server" Width="40%"
> CssClass="datagrid " AutoPostBack="True" OnSelectedIndexChanged="script > language="VBScript"> MsgBox "Hello there" </script>"></asp:dropdownlist> >
> I get the red-squiggly on ="VBScript" and "Hello There" and of
course a > build error when I try to run it. What I really need to do is validate
a
> selection from the dropdown list box (a date), if it is not the

current > date, then I need a msg or alert box to warn the user that their

selection
> is not current and that the data they will be viewing is not updateable. > Where do I need to put this code to get it to run after a selection has been
> made? Any suggestions? Thanks
>
> Coleen
>
>



Jul 21 '05 #5

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

Similar topics

1
by: L-and-F | last post by:
www.lee-mcgeorge.co.uk I've been using custom Alert boxes for a long time in various guises. The way I've shown below is perhaps the easiest. There are more efficient and cleaner ways to do it,...
6
by: Steve B. | last post by:
Hello everybody In a webpage, I use JS display data from an xml file and a xsl file: var data = new ActiveXObject("Microsoft.XMLDOM"); data.async = false; var dataUrl = "data.aspx";...
4
by: Coleen | last post by:
Please see threads on "Dumb question about Message boxes" - I went to the specified link - this works great if all you want to do is display a message box before any of your script behind the...
7
by: Jeff | last post by:
I am new to VB.net 2005 in visual web developer, and even newer to Javascript. I need a java alert box that contains text that eventually will come from an sql table. The alert box should...
2
by: Chamomile | last post by:
Does anyone know a way to disable the 'refresh alert' windown that pops up in ie when document.location.reload() is used on a page that has post data? In thecontext I'm using reload() this...
8
by: LisaC | last post by:
I have a form with a number of text boxes for prices. I'm trying to write a javascript function that will pop up a alert if the price entered is 0.00. I want to use the onchange event on the text...
1
by: sivaprasadch | last post by:
please can any one suggest me to how to display the alert message text in the different languages. iam implementing localization and globalization concept in my application ,when i change the...
2
by: Jonathan N. Little | last post by:
As part of a JavaScript precheck form validation I noticed a problem with trying to return focus to the field with an error. I have setup a demo page. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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.