conditional javascript in asp.net

Z

Zdenko Rupcic

I want to add a javascript which would execute only if certain
requirements are met.
Example:
If user isn't logged in, a message box would pop up, telling the user he
has to log in, but if the user is already logged in, there would be no message.

In classical asp, I would do it like this:

<body<% IF LEN(Session("username"))=0 THEN Response.Write " onLoad=""alert('You need to log in for more info!')""" %>>

How to do that in asp.net, using .vb code? I know how to add javascript events for controls, but not for the page body.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top