Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:17 PM
JT
Guest
 
Posts: n/a
Default msgbox

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




  #2  
Old July 19th, 2005, 02:17 PM
Aaron [SQL Server MVP]
Guest
 
Posts: n/a
Default Re: msgbox

http://www.aspfaq.com/2198

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




"JT" <jt@nospam.com> wrote in message
news:#LMsb1abEHA.3728@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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[/color]
side[color=blue]
> 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[/color]
works[color=blue]
> in terms of client side vs server side.
>
> any help would be much appreciated
>
> jt
>
>
>
>[/color]


  #3  
Old July 19th, 2005, 02:17 PM
Ray at
Guest
 
Posts: n/a
Default Re: msgbox

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:%23LMsb1abEHA.3728@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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
>
>
>
>[/color]


  #4  
Old July 19th, 2005, 02:17 PM
Rob Collyer
Guest
 
Posts: n/a
Default Re: msgbox

"JT" <jt@nospam.com> wrote in
news:#LMsb1abEHA.3728@TK2MSFTNGP10.phx.gbl:
[color=blue]
> 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
>
>
>
>
>[/color]

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 !
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles