client side asp within server side asp

im trying to use the following code to log whenever a user clicks through
this particlular message box - however, this currently logs regardless of
whether or not the message box was clicked - im assuming this is because the
server-side code can't see the client side if condition. but how can i set
the varMsgBox variable as a server-side variable?

Advertisements

JT wrote:
> im trying to use the following code to log whenever a user clicks
> through this particlular message box - however, this currently logs
> regardless of whether or not the message box was clicked - im
> assuming this is because the server-side code can't see the client
> side if condition. but how can i set the varMsgBox variable as a
> server-side variable?
>
You can't. All server-side code runs before client-side code is processed.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Advertisements

"Bob Barrows [MVP]" <> wrote in message
news:...
> JT wrote:
> > im trying to use the following code to log whenever a user clicks
> > through this particlular message box - however, this currently logs
> > regardless of whether or not the message box was clicked - im
> > assuming this is because the server-side code can't see the client
> > side if condition. but how can i set the varMsgBox variable as a
> > server-side variable?
> >
> You can't. All server-side code runs before client-side code is processed.
>
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

No, because by the time the message box comes up, control has switched to
the client.

Bob Lehmann

"JT" <> wrote in message
news:...
> but isn't there a way to somehow do it along the lines of what is
discussed
> in this article?
>
> http://www.aspfaq.com/show.asp?id=2198
>
>
> "Bob Barrows [MVP]" <> wrote in message
> news:...
> > JT wrote:
> > > im trying to use the following code to log whenever a user clicks
> > > through this particlular message box - however, this currently logs
> > > regardless of whether or not the message box was clicked - im
> > > assuming this is because the server-side code can't see the client
> > > side if condition. but how can i set the varMsgBox variable as a
> > > server-side variable?
> > >
> > You can't. All server-side code runs before client-side code is
processed.
> >
> >
> > --
> > Microsoft MVP -- ASP/ASP.NET
> > Please reply to the newsgroup. The email account listed in my From
> > header is my spam trap, so I don't check it very often. You will get a
> > quicker response by posting to the newsgroup.
> >
> >
>
>

No, that article talks about what you've successfully done: cause a
client-side action from from server-side code. It's a one-way street. Data
can only be passed to server-side code via the Request object, which only
exists when the page is initially called.

To do what you want will involve another page.

Bob Barrows

JT wrote:
> but isn't there a way to somehow do it along the lines of what is
> discussed in this article?
>
> http://www.aspfaq.com/show.asp?id=2198
>
>
> "Bob Barrows [MVP]" <> wrote in message
> news:...
>> JT wrote:
>>> im trying to use the following code to log whenever a user clicks
>>> through this particlular message box - however, this currently logs
>>> regardless of whether or not the message box was clicked - im
>>> assuming this is because the server-side code can't see the client
>>> side if condition. but how can i set the varMsgBox variable as a
>>> server-side variable?
>>>
>> You can't. All server-side code runs before client-side code is
>> processed.
>>
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

"JT" <> wrote in message
news:...
> but isn't there a way to somehow do it along the lines of what is
> discussed
> in this article?
>
> http://www.aspfaq.com/show.asp?id=2198
>
>
> "Bob Barrows [MVP]" <> wrote in message
> news:...
>> JT wrote:
>> > im trying to use the following code to log whenever a user clicks
>> > through this particlular message box - however, this currently logs
>> > regardless of whether or not the message box was clicked - im
>> > assuming this is because the server-side code can't see the client
>> > side if condition. but how can i set the varMsgBox variable as a
>> > server-side variable?
>> >
>> You can't. All server-side code runs before client-side code is
>> processed.
>>
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get a
>> quicker response by posting to the newsgroup.
>>
>>
>
>

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!