473,788 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript alert message problem

Hello.

I'm developing and testing a web application using VS.NET 2003, VB, .NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

Using this line of code works great. It displays a little message box with
the alert message in it.

Me.btnGetArchiv edTrips.Attribu tes.Add("onMous eOver", "alert('mou se over')")

But how do i get it to display the alert message without doing a mouse over,
just trying to put it into an if statement ?

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If

Thanks,
Tony
Oct 4 '06 #1
22 2326
"Tony Girgenti" <tony(nospam)@l akesideos.comwr ote in message
news:uk******** ******@TK2MSFTN GP06.phx.gbl...
Using this line of code works great. It displays a little message box
with the alert message in it.

Me.btnGetArchiv edTrips.Attribu tes.Add("onMous eOver", "alert('mou se
over')")

But how do i get it to display the alert message without doing a mouse
over, just trying to put it into an if statement ?

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If
Er...have you tried

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
Me.btnGetArchiv edTrips.Attribu tes.Add("onMous eOver", "alert('mou se
over')")
End If
Oct 4 '06 #2
Hello Mark.

I guess i didn't explain my problem correctly. Within the if statement, i
just want the alert part. In other words if the startdate/enddate compare
is true, i want a little message to pop up that indicates the problem. Like
"Dates are incorrect".

Thanks for your reply.

Tony

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:e6******** ******@TK2MSFTN GP05.phx.gbl...
"Tony Girgenti" <tony(nospam)@l akesideos.comwr ote in message
news:uk******** ******@TK2MSFTN GP06.phx.gbl...
>Using this line of code works great. It displays a little message box
with the alert message in it.

Me.btnGetArchi vedTrips.Attrib utes.Add("onMou seOver", "alert('mou se
over')")

But how do i get it to display the alert message without doing a mouse
over, just trying to put it into an if statement ?

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If

Er...have you tried

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
Me.btnGetArchiv edTrips.Attribu tes.Add("onMous eOver", "alert('mou se
over')")
End If


Oct 4 '06 #3
if i know vb well enough:

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
Page.ClientScri pt.RegisterClie ntScriptBlock(m e.GetType(),"al ert","alert('mo use
over');",true)
End If

-- bruce (sqlwork.com)

"Tony Girgenti" <tony(nospam)@l akesideos.comwr ote in message
news:uk******** ******@TK2MSFTN GP06.phx.gbl...
Hello.

I'm developing and testing a web application using VS.NET 2003, VB, .NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

Using this line of code works great. It displays a little message box
with the alert message in it.

Me.btnGetArchiv edTrips.Attribu tes.Add("onMous eOver", "alert('mou se
over')")

But how do i get it to display the alert message without doing a mouse
over, just trying to put it into an if statement ?

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If

Thanks,
Tony

Oct 4 '06 #4
Hello Bruce.

This is not working because the IDE is saying "ClientScri pt is not a member
of System.Web.UI.P age". I can't figure out how to code it so that it is
accepted by the coding syntax.

Thanks,
Tony

"bruce barker (sqlwork.com)" <b_************ *************@s qlwork.comwrote
in message news:ud******** ******@TK2MSFTN GP06.phx.gbl...
if i know vb well enough:

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then

Page.ClientScri pt.RegisterClie ntScriptBlock(m e.GetType(),"al ert","alert('mo use
over');",true)
End If

-- bruce (sqlwork.com)

"Tony Girgenti" <tony(nospam)@l akesideos.comwr ote in message
news:uk******** ******@TK2MSFTN GP06.phx.gbl...
>Hello.

I'm developing and testing a web application using VS.NET 2003, VB, .NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

Using this line of code works great. It displays a little message box
with the alert message in it.

Me.btnGetArchi vedTrips.Attrib utes.Add("onMou seOver", "alert('mou se
over')")

But how do i get it to display the alert message without doing a mouse
over, just trying to put it into an if statement ?

If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If

Thanks,
Tony


Oct 5 '06 #5
Hello Bruce.
>
This is not working because the IDE is saying "ClientScri pt is not a
member of System.Web.UI.P age". I can't figure out how to code it so that
it is accepted by the coding syntax.
I think you are using ASP.Net 1.1

Coming to your original problem:
If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If
Solution suggested by Mark is correct way to go about it...

What you are expecting above is:

1. Manipulation of the Data on the server side
2. Alert on the client side

=Two things happening together is not possible.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://articles.edujinionline.com/webservices
-----------------------------------------
Oct 5 '06 #6
Hello Gaurav.

I think i understand what you are saying. Correct me if i am wrong. Are
you saying that this part of the statement "If Calendar1.Selec tedDate >
Me.Calendar2.Se lectedDate Then"
is occurring on the server side, but this part "alert('mou se over')")" is
happening on the client side ?

If that's the case, then how do i go about doing this ? I tried putting it
into the HTML, but i can't get it to execute the function.

Thanks,
Tony

"Gaurav Vaish (www.EdujiniOnl ine.com)"
<ga************ *****@nospam.gm ail.comwrote in message
news:uT******** ******@TK2MSFTN GP02.phx.gbl...
>Hello Bruce.

This is not working because the IDE is saying "ClientScri pt is not a
member of System.Web.UI.P age". I can't figure out how to code it so that
it is accepted by the coding syntax.

I think you are using ASP.Net 1.1

Coming to your original problem:
>If Calendar1.Selec tedDate Me.Calendar2.Se lectedDate) Then
alert('mouse over')")
End If

Solution suggested by Mark is correct way to go about it...

What you are expecting above is:

1. Manipulation of the Data on the server side
2. Alert on the client side

=Two things happening together is not possible.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://articles.edujinionline.com/webservices
-----------------------------------------


Oct 5 '06 #7
Tony Girgenti (nospam) wrote:
Hello Bruce.

This is not working because the IDE is saying "ClientScri pt is not a member
of System.Web.UI.P age". I can't figure out how to code it so that it is
accepted by the coding syntax.

Thanks,
Tony
In 1.1, it would be
Me.RegisterClie ntScriptBlock(" warning","<scri pt>alert('hello ');</script>")

Damien

Oct 5 '06 #8
I think i understand what you are saying. Correct me if i am wrong. Are
you saying that this part of the statement "If Calendar1.Selec tedDate >
Me.Calendar2.Se lectedDate Then"
is occurring on the server side, but this part "alert('mou se over')")" is
happening on the client side ?

If that's the case, then how do i go about doing this ? I tried putting
it into the HTML, but i can't get it to execute the function.
Bingo!
You got it right...

You need to do something like this:

if Calendar1.Selec tedDate Me.Calendar2.Se lectedDate Then
Me.Page.Registe rClientScriptBl ock("Unique_Nam e_Like_Calendar 1_Error",_
"<script type='text/javascript'
language='javas cript'>alert('E rror in selected date');</script>")
End if

What this will do is emit this script just before the end of "form"
element... ie, near the end of the page. And will give an alert almost
immediately as the page gets completely loaded.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://articles.edujinionline.com/webservices
-----------------------------------------
Oct 7 '06 #9
Wow. That's great. Thanks to you and Damien for your code.

I need to learn more about scripting, but i'm confused about all the
scripting terminology. When i do searches for javascript, i always seem to
get returns that involve VBscript, Jscript, javascript, client-side scripts,
HTML etc.

What is it that i should be looking for ? and should i be looking for a
particular version ? Is what you did for me called "javascript " ?

Also, the second line of the HTML code for my web page is "<!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">". Does that mean the HTML
version is 4.0 ?

Any help would be gratefully appreciated.

Thanks again,
Tony

"Gaurav Vaish (www.EdujiniOnl ine.com)"
<ga************ *****@nospam.gm ail.comwrote in message
news:e1******** ******@TK2MSFTN GP03.phx.gbl...
>I think i understand what you are saying. Correct me if i am wrong. Are
you saying that this part of the statement "If Calendar1.Selec tedDate >
Me.Calendar2.S electedDate Then"
is occurring on the server side, but this part "alert('mou se over')")" is
happening on the client side ?

If that's the case, then how do i go about doing this ? I tried putting
it into the HTML, but i can't get it to execute the function.

Bingo!
You got it right...

You need to do something like this:

if Calendar1.Selec tedDate Me.Calendar2.Se lectedDate Then
Me.Page.Registe rClientScriptBl ock("Unique_Nam e_Like_Calendar 1_Error",_
"<script type='text/javascript'
language='javas cript'>alert('E rror in selected date');</script>")
End if

What this will do is emit this script just before the end of "form"
element... ie, near the end of the page. And will give an alert almost
immediately as the page gets completely loaded.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://articles.edujinionline.com/webservices
-----------------------------------------


Oct 9 '06 #10

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

Similar topics

7
2826
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) My code is below. I am getting the following error "MyForm.oNetwork.Value is Null or is not an object". I'm struggling to diagnose what to do next. I'd very much appreciate some help Many thanks <HTML><BODY><FORM NAME="MyForm"...
14
5486
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I have been able to come. I added a little asp.net code and an asp.net button and cannot get it to
3
2020
by: dgmoore | last post by:
Hello - I'm having trouble with JavaScript alerts in an imagemap. The mapped areas are cells in a table, and the alerts display info related to the cell that is clicked. The problem is that, even though the source html is correct, the alert messages that are displayed appear to be random, i.e., the alert for row 10 appears when row 3 is clicked, etc. On some long tables, the same alert message is displayed for (nearly) every row even...
7
1683
by: e | last post by:
I've been having an extremely difficult time finding an answer to this in IE / js groups, so I thought I'd try here. I've got an aspx page that delivers loads of report data into custom-named <span> tags on the client, hidden from the screen by @media classes. From a dynamically built menu of what was returned, the user selects wich report they want to view/print and a little jscript .innerHTML magic happens under the hood that copies...
6
1577
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"; data.load(dataUrl) ; var transform = new ActiveXObject("Microsoft.XMLDOM"); transform.async = false ;
9
4923
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work fine from a link. The button does bring up the popup window, but when I press the links on the page, it doesn't return or close the window. ****************************************************************************
8
2609
by: Frank | last post by:
Hi, I am working with VS.NET 2005 Ultimately, I wish to call a JavaScript function from a .js file
2
2184
by: verci | last post by:
Hi guys, sorry if this seems stupid but I'm a newbie, I'm running Windows XP Pro SP2, IE 7, VS2005, ASP.net 2.0 The problem is that I'm trying to display this news scroller made in a Javascript file(newsscroller.js) in my ASP page, everything works great in a normal HTML page, I can see the scroller just fine, but in an ASP page it just does not show, I get some error message that the control has not been initialize, so far I've been...
16
1919
by: Tony Girgenti | last post by:
Hello. I just finished reading two articles about javascript here: http://msdn2.microsoft.com/en-us/library/bb332123(VS.80).aspx I tried some javascript testing in VS2005, SP1, VB , .NET 2.0, ASP.NET 2.0 on WIN XP Pro, SP2. It's real simple. I put a button on a page and coded the onClick in it like this:
9
2219
by: Matthew Wells | last post by:
OK, I've narrowed down the problem. This works when in the aspx page <script type="text/javascript" > function btnFirst_Click() { alert("Hello"); alert(document.getElementById("<%=LBFacilities.ClientID%>").options.length); return false; } </script>
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.