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

msgbox

JT
im trying to use the MsgBox function in the following to display an ASP
MsgBox containing text retrieved from the db into a recordset

<%
set rsMessages= myRecordset
msg_text = rsMessages.Fields("msg_text")
msgbox(msg_text)
%>

this generates a permission denied error b/c msgbox needs to run client side
so i tried the same code but used

<SCRIPT LANGUAGE="VBSCRIPT">
</SCRIPT>

in place of the <% %> tags

but now i just get an empty message box

i must be misunderstanding something with the way the msgbox function works
in terms of client side vs server side.

any help would be much appreciated

jt


Jul 19 '05 #1
3 3108
http://www.aspfaq.com/2198

--
http://www.aspfaq.com/
(Reverse address to reply.)


"JT" <jt@nospam.com> wrote in message
news:#L**************@TK2MSFTNGP10.phx.gbl...
im trying to use the MsgBox function in the following to display an ASP
MsgBox containing text retrieved from the db into a recordset

<%
set rsMessages= myRecordset
msg_text = rsMessages.Fields("msg_text")
msgbox(msg_text)
%>

this generates a permission denied error b/c msgbox needs to run client side so i tried the same code but used

<SCRIPT LANGUAGE="VBSCRIPT">
</SCRIPT>

in place of the <% %> tags

but now i just get an empty message box

i must be misunderstanding something with the way the msgbox function works in terms of client side vs server side.

any help would be much appreciated

jt

Jul 19 '05 #2
Well, you understand server-side vs. client-side. Now all you have to do is
bridge the two together. You want to use a msgbox, which MUST take place in
the client environment, but you want to display data that is available in
the server-side environment. So, you need to pass the server-side value to
something that the client can see. Here's how to do that.

<%
'''server side code
set rsMessages= myRecordset
msg_text = rsMessages.Fields("msg_text")
%>

<script language="vbscript">
''client side code
msgbox "<%=msg_text%>"
</script>

You'll notice when you load the page and view source, the client-side script
will have the literal value of msg_text the same way that it would if you
just put something like <td><%=msg_text%></td> somewhere.

BTW, client-side vbscript is pretty much ill-advised...

Ray at work

"JT" <jt@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
im trying to use the MsgBox function in the following to display an ASP
MsgBox containing text retrieved from the db into a recordset

<%
set rsMessages= myRecordset
msg_text = rsMessages.Fields("msg_text")
msgbox(msg_text)
%>

this generates a permission denied error b/c msgbox needs to run client
side
so i tried the same code but used

<SCRIPT LANGUAGE="VBSCRIPT">
</SCRIPT>

in place of the <% %> tags

but now i just get an empty message box

i must be misunderstanding something with the way the msgbox function
works
in terms of client side vs server side.

any help would be much appreciated

jt

Jul 19 '05 #3
"JT" <jt@nospam.com> wrote in
news:#L**************@TK2MSFTNGP10.phx.gbl:
im trying to use the MsgBox function in the following to display an
ASP MsgBox containing text retrieved from the db into a recordset

<%
set rsMessages= myRecordset
msg_text = rsMessages.Fields("msg_text")
msgbox(msg_text)
%>

this generates a permission denied error b/c msgbox needs to run
client side so i tried the same code but used

<SCRIPT LANGUAGE="VBSCRIPT">
</SCRIPT>

in place of the <% %> tags

but now i just get an empty message box

i must be misunderstanding something with the way the msgbox function
works in terms of client side vs server side.

any help would be much appreciated

jt



maybe i mis-understand you, but if you are trying to generate a msgbox
with SERVER side code (on the server), then you';ll be at it forever....
it cant be done with JUST asp.

--
Robert Collyer
www.webforumz.com
Free Web Design and Development Help, Discussions, tips and Critique!
ASP, VB, .NET, SQL, CSS, HTML, Javascript, Flash, XML, SEO !
Jul 19 '05 #4

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

Similar topics

1
by: Peter Bassett | last post by:
In my ASP script I call Javascript for a msgbox after the user has submitted the form of their resume information. I saw this example as a way to get a msgbox onto the client from ASP since server...
2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
4
by: Lakrom | last post by:
Hi to all, how to put msgbox in this asp page, this send me a message Denied permission: 'MsgBox' <% Set Conn=server.createobject("ADODB.connection") Conn.open application("StrConRuta") set rs =...
6
by: Lapchien | last post by:
In this bit of code provided so helpfully by Nath: Private Sub Command118_Click() Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.openrecordset("IMPORT")
8
by: deko | last post by:
Can I close a MsgBox with VBA Code? Something like: If IsOpen (MsgBox, "Title") Then Close(MsgBox, "Title") Run some code Else Run other code End If Can this be done in VBA? Do I need to...
2
by: Radith Silva | last post by:
I need to use the MsgBox function like I used to in VB 6.0 So all i do is: MsgBox ("Please provide Input") BUT IN .NET: The error reads "msgbox is a namespace"
4
by: James | last post by:
What does this mean? 'To specify more than the first argument, you must use the MsgBox function in an expression' I'd love to see an example. Thanks!
9
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter...
2
by: perkykoala | last post by:
I apologize in advance for being REALLY detailed/verbose. It's the result of staring/tweaking code for too long. Using VB 2005: I need to design a multiple choice test (unfortunately, I can't...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.