Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Recordset navigation problem

Posted 29 Sep 2004 15:32:54
1
has voted
29 Sep 2004 15:32:54 SLobodan Gogic posted:
Hi guys, hope You will help me...
Here is situation...
Im creating cms. I have 2 types of users, normal and admin. I have one main.asp, in that page im using include file to include proper recordset files. One recordset is based on comparing author string in recordset with session string, and other file is complete recordset for admin to see all articles. Both files have recordset navigation on them.
Now, I have added conditional region which looks like
<% if Session("MM_UserName" <> "admin" then ' Adv Conditional Region %>
<!--#include file="list.asp"-->
<% end if %>
and onother one which looks the same but condition is = "admin".
<% if Session("MM_UserName" = "admin" then ' Adv Conditional Region %>
<!--#include file="lista.asp"-->
<% end if %>
When I try to login, I get error that variable is redefined. Which indicates that both include files are included and giving error.
My question is why it is redefined when only one condition is true, thus only one iclude should be included?
After some acrobatics, i have managed to work almost ok, since I have changed all vars in second file, but then navigation is going by 1 not by 10 rows that is specified in repeat region...
Also, can someone please tell me how can I workaround this and I dont want to have separate pages for editors and admins, so I want only 1 page which will include proper recordset list based on above conditions...
Thanks in advance
Boban

Replies

Replied 29 Sep 2004 15:58:13
29 Sep 2004 15:58:13 Lee Diggins replied:
The problem here is with dynamic SSI, you can't do it apparently.

Why not create one include file with the if statement in?

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 29 Sep 2004 16:14:10
29 Sep 2004 16:14:10 Lee Diggins replied:
However if you use a select case statement, rather than you IF you can have dynamic includes:

<%
Dim whichpage
whichpage = Session("MM_UserName"
Select Case whichpage
Case "admin" %>
<!--#include file="list.asp"-->
<% Case Else %>
<!--#include file="lista.asp"-->
<%End Select%>

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 29 Sep 2004 17:12:02
29 Sep 2004 17:12:02 SLobodan Gogic replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
However if you use a select case statement, rather than you IF you can have dynamic includes:

&lt;%
Dim whichpage
whichpage = Session("MM_UserName"
Select Case whichpage
Case "admin" %&gt;
&lt;!--#include file="list.asp"--&gt;
&lt;% Case Else %&gt;
&lt;!--#include file="lista.asp"--&gt;
&lt;%End Select%&gt;

Digga

Sharing Knowledge Saves Valuable Time!!!
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Thanks mate, that should do it... didnt think of working all in one file with IF then, will try it also...
Thanks again

Reply to this topic