Forums

This topic is locked

conditional hide region

Posted 01 Apr 2002 00:10:29
1
has voted
01 Apr 2002 00:10:29 Dave Clarke posted:
hi all

i have a couple of extensions installed that will hide a region if a session variable doesnt exist but i need one that will hide a region if a session variable DOES exist.
does anybody know of one or how i can edit the code in my page to do the job?

thanks

dave
p.s what i'm trying to do is hide the login form if users are already logged in

Replies

Replied 01 Apr 2002 13:13:13
01 Apr 2002 13:13:13 Matthijs Horsman replied:
Hi Davecl

Maybe something like,

<% if request.querystring("yourstring" = "show" Then %> form to login <% else %> Hi Davecl <% end if %>

not sure if it works but maybe it helps...

Matthijs
Replied 01 Apr 2002 15:25:48
01 Apr 2002 15:25:48 Viktor Farcic replied:
Since you want to check if session variable exists:
<% if Session("SessionName" <> "" Then %>
Session Exists
<% else %>
Session Doesn't Exists
<% end if %>


Viktor Farcic

TalkZone Manager
Replied 02 Apr 2002 12:01:00
02 Apr 2002 12:01:00 Dave Clarke replied:
hi guys

still no joy, even after your email help viktor.
but i have had an idea, i will put another layer over the top that is hidden if session doesn't exist, so when it does, it will hide and reveal the underneath layer.

Dave
Replied 02 Apr 2002 16:11:08
02 Apr 2002 16:11:08 Viktor Farcic replied:
There's no need for layers.
Post the code here (not on my email) and I or somebody else will try to solve this. Don't post complete code, just the part you're having trouble with.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hi guys

still no joy, even after your email help viktor.
but i have had an idea, i will put another layer over the top that is hidden if session doesn't exist, so when it does, it will hide and reveal the underneath layer.

Dave
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager
Replied 03 Apr 2002 22:03:30
03 Apr 2002 22:03:30 Mark Wills replied:
1)Open any page in your project
2)From the Server Behaviours tab, click the + button, and select 'New Server Behaviour'
3)Make sure the Server Model is ASP/VB Script
4)For the name, enter 'Show if Session Var Exists'
5)When the code window opens, create a new code section by clicking on the + button. Name the code section 'If_Section'
6)Enter the following into the code blobk window:

&lt;% If CStr(Session("@@Session Variable Name@@")&lt;&gt;"" Then %&gt;

7)In the 'Insert Code' drop down list, select 'Relative to the selection'
8)In the 'relative position' drop down box, select 'Before the selection'
9)Create a new code block, by clicking the + button, call this section 'End_If_Section'
10)In the code block section, enter the following code:

&lt;% End If %&gt;

11)In the 'Insert Code' drop down list, select 'Relative to the selection'
12)In the 'relative position' drop down box, select 'After the Selection'
13)Click the Next button in the top right corner.
14)Click OK on the next screen.
15)You have just built the server behaviour you require. To use it, just select a section of your page, like some text for example, and then select the behaviour from the server behaviour window in the normal way.

Hope this come in handy.

All the best,

Mark Wills.


Replied 04 Apr 2002 00:16:41
04 Apr 2002 00:16:41 Dave Clarke replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
1)Open any page in your project
2)From the Server Behaviours tab, click the + button, and select 'New Server Behaviour'
3)Make sure the Server Model is ASP/VB Script
4)For the name, enter 'Show if Session Var Exists'
5)When the code window opens, create a new code section by clicking on the + button. Name the code section 'If_Section'
6)Enter the following into the code blobk window:

&lt;% If CStr(Session("@@Session Variable Name@@")&lt;&gt;"" Then %&gt;

7)In the 'Insert Code' drop down list, select 'Relative to the selection'
8)In the 'relative position' drop down box, select 'Before the selection'
9)Create a new code block, by clicking the + button, call this section 'End_If_Section'
10)In the code block section, enter the following code:

&lt;% End If %&gt;

11)In the 'Insert Code' drop down list, select 'Relative to the selection'
12)In the 'relative position' drop down box, select 'After the Selection'
13)Click the Next button in the top right corner.
14)Click OK on the next screen.
15)You have just built the server behaviour you require. To use it, just select a section of your page, like some text for example, and then select the behaviour from the server behaviour window in the normal way.

Hope this come in handy.

All the best,

Mark Wills.



<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 04 Apr 2002 00:19:12
04 Apr 2002 00:19:12 Dave Clarke replied:
thanks mark

but ud is set up as asp/javascript, so vbscript behaviors dont work do they?

Dave


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
1)Open any page in your project
2)From the Server Behaviours tab, click the + button, and select 'New Server Behaviour'
3)Make sure the Server Model is ASP/VB Script
4)For the name, enter 'Show if Session Var Exists'
5)When the code window opens, create a new code section by clicking on the + button. Name the code section 'If_Section'
6)Enter the following into the code blobk window:

&lt;% If CStr(Session("@@Session Variable Name@@")&lt;&gt;"" Then %&gt;

7)In the 'Insert Code' drop down list, select 'Relative to the selection'
8)In the 'relative position' drop down box, select 'Before the selection'
9)Create a new code block, by clicking the + button, call this section 'End_If_Section'
10)In the code block section, enter the following code:

&lt;% End If %&gt;

11)In the 'Insert Code' drop down list, select 'Relative to the selection'
12)In the 'relative position' drop down box, select 'After the Selection'
13)Click the Next button in the top right corner.
14)Click OK on the next screen.
15)You have just built the server behaviour you require. To use it, just select a section of your page, like some text for example, and then select the behaviour from the server behaviour window in the normal way.

Hope this come in handy.

All the best,

Mark Wills.



<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 04 Apr 2002 01:27:45
04 Apr 2002 01:27:45 Owen Eastwick replied:
Well, this is why none of the answers work, they are all ASP/VBScript. Looking at the users on the forum I would imagine 90% or more are working in ASP/VBScript, so unless you state otherwise they are liable to assume that you are too.

Sorry, can't give you the answer, I'm one of the 90%

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 04 Apr 2002 08:34:15
04 Apr 2002 08:34:15 Viktor Farcic replied:
90%??? It's more like 98-99%.

Viktor Farcic

TalkZone Manager
Replied 04 Apr 2002 11:52:59
04 Apr 2002 11:52:59 Dave Clarke replied:
OOOOOOOOPPS

sorry guys

I did try UD with ASP/VBSCRIPT but when testing my pages with IIS it was taking almost a minute for the pages to appear in IE, so I went back to ASP/JAVASCRIPT.
If any body knows why IIS is doing this, I would love to know.
I am constructing the site on one pc with xphome and testing it via local network to another running IIS on xp pro.
sorry again guys and thanks.

Dave

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Well, this is why none of the answers work, they are all ASP/VBScript. Looking at the users on the forum I would imagine 90% or more are working in ASP/VBScript, so unless you state otherwise they are liable to assume that you are too.

Sorry, can't give you the answer, I'm one of the 90%

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic