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

Alert Message

kirubagari
158 100+
Expand|Select|Wrap|Line Numbers
  1. <%        
  2. set cn = server.CreateObject("ADODB.CONNECTION")
  3. cn.open Session("IE_conn")
  4. set rsuser= server.CreateObject("ADODB.RECORDSET")             
  5. sql = "SELECT * FROM SIL_WAFERSTART_LOGIN Where logouttime is null"
  6. set rsuser= cn.execute(sql)
  7. if not (rsuser.eof) then
  8. Response.Write "<script type='text/javascript'>alert(" & rsuser("login") & ");</script>"
  9.  
Hi im having problem when pass d value in alert message?
There is no alert message prompt.If i replace with string the alert message prompt without any problem.
Please help
Aug 8 '12 #1
3 2478
Rabbit
12,516 Expert Mod 8TB
You need to enclose the parameter to alert in quotes.
Expand|Select|Wrap|Line Numbers
  1. Response.Write "<script type='text/javascript'>alert('" & rsuser("login") & "');</script>" 
Aug 8 '12 #2
kirubagari
158 100+
Hi,

Thanks.
I have assigned the value into variable but the alert is not prompt up.

Alert message is prompt up if the variable is string:
Expand|Select|Wrap|Line Numbers
  1. <%        
  2. set cn = server.CreateObject("ADODB.CONNECTION")
  3. cn.open Session("RE_conn")
  4. set rsuser= server.CreateObject("ADODB.RECORDSET")             
  5. sql = "SELECT * FROM SIL_ABC_LOGIN Where logouttime is null"
  6. set rsuser= cn.execute(sql)
  7. if not (rsuser.eof) then
  8. MyVariable = "Yet to be developed."
  9. Response.Write "<script type='text/javascript'>alert('" & MyVariable & "');</script>"
  10.  
  11. end if 
  12. %>
Alert message is not prompt up if i replace with sql data.Please help.I have attached the error for expert reference.

Expand|Select|Wrap|Line Numbers
  1. <%        
  2. set cn = server.CreateObject("ADODB.CONNECTION")
  3. cn.open Session("RE_conn")
  4. set rsuser= server.CreateObject("ADODB.RECORDSET")             
  5. sql = "SELECT * FROM SIL_ABC_LOGIN Where logouttime is null"
  6. set rsuser= cn.execute(sql)
  7. if not (rsuser.eof) then
  8. MyVariable = rsuser ("login")
  9. Response.Write "<script type='text/javascript'>alert('" & MyVariable & "');</script>"
  10. end if 
  11. %>
Attached Images
File Type: jpg untitled.jpg (58.6 KB, 166 views)
Aug 9 '12 #3
Rabbit
12,516 Expert Mod 8TB
If there are any single quotes in the variable data, you will have to escape them.
Aug 9 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: iceking | last post by:
Hi, I have a php script that checks whether the user is allowed to perform an action. If he is not allowed; I display a warning; using the alert function. After clicking away this function, I want...
1
by: Ali | last post by:
Hello! I am trying make a alert message in an asp.net application, but i ned that the button tha appear into the message change the languaje depending the user. Anybody know hoe i can do that? ...
1
by: Vivian | last post by:
I've created a web page with ASP .NET and C#. Say my aspx filename is "WebForm1.aspx", I have created another C# file named "Details.cs". My problem is I want to prompt an alert message from both...
22
by: Tony Girgenti | last post by:
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...
3
by: Wayne Deleersnyder | last post by:
Hi All, I'm trying to create a function that will cause a pop-up alert to appear if dates which were chosen from a drop-down list were invalid on a page. There's 4 dates, so there's the...
15
by: cyberlei | last post by:
Hey guys, i was trying to use alert message for php string,but dunno why the alert can`t be displayed, so please help me where i did wrong, THANKS SO MUCH here is the code: <SCRIPT...
5
by: cyberlei | last post by:
Hey Guys, Just wandering if I can display alert message with a default sound. the current code is below and the problem is no sounds. function disp_alert() { alert("test") } and...
3
by: nagmvs | last post by:
Hai guys, I want the the code to disable Left Mouse button with out Alert message. Below code i am having <!-- This code is for disableing left click--> <script language="javascript">...
2
by: shrinivas singh | last post by:
If I remove alert messsage,it works fine.But, with alert message nothing is displayed after alert message but the blank screen.Below is the code: <iframe width = "100%" height = "1100" src =...
0
by: Anupam Jana | last post by:
Hello All, I want to redirect to some other directory page after displaying JavaScript alert message in ASP.net in a page. For that I tried bellow code in our application...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.