Trying to achieve this functionality in ASP.NET.
<cfif NOT session.loggedin>
<cfinclude template="loginPage.cfm">
<cfelse>
<cfif session.loginType EQ "Instructor">
... show Instructor menu...
<cfif form.menuItem EQ 1>
<cfinclude template="MenuItem1Page.cfm">
<cfelseif form.menuItem EQ 2>
.......
</cfif>
<cfelseif session.loginType EQ "Reviewer">
... show Reviewer menu ...
... includes for Reviewers
</cfif>
</cfif>
Trying nested master pages but having trouble implementing the nesting
(Whidbey beta 1). Also not sure how to navigate between NOT logged in and
logged in and among menuItem pages. Thanks in advance. 7 2196
I'm not familiar with Cold Fusion, but I know it is similar to ASP. So,
forgive me if I interpret you incorrectly, but it sure looks like your
"cfinclude" tag is, in essence, a dynamic include file. If so, as ASP.Net is
object-oriented, you would want to create a class instead, either a User
Control (if you want to use a template) or a Server Control (which is a pure
class), and conditionally create an instance of it and place it in your
page.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com... Trying to achieve this functionality in ASP.NET. <cfif NOT session.loggedin> <cfinclude template="loginPage.cfm"> <cfelse> <cfif session.loginType EQ "Instructor"> ... show Instructor menu... <cfif form.menuItem EQ 1> <cfinclude template="MenuItem1Page.cfm"> <cfelseif form.menuItem EQ 2> ....... </cfif> <cfelseif session.loginType EQ "Reviewer"> ... show Reviewer menu ... ... includes for Reviewers </cfif> </cfif> Trying nested master pages but having trouble implementing the nesting (Whidbey beta 1). Also not sure how to navigate between NOT logged in and logged in and among menuItem pages. Thanks in advance.
Thanks, Kevn. You inferred correctly re Cold Fusion. I think a structure
like this would work - pseudocode:
Main.master (<html><links><meta> etc.)
if not logged in then
LoginRoutine.aspx
elseif login successful then
if user is Instructor then
Instructor.master (containing menu options)
InstructorFunction_1.aspx
......
InstructorFunction_N.aspx
elseif user is Reviewer then
Reviewer.master (containing reviewer menu options)
ReviewerFuntion_1.aspx
....
ReviewerFuntion_N.aspx
endif
endif
I think I've figured out the basic plumbing of nested masters since my
original post.
But still not sure of best way to transfer from page to page. Have been
doing the following which seems to work but it's unappealing:
httpContext.Current.Response.Redirect(xxx.aspx) in a content page's
Load_Page method.
Is there a better way?
"Kevin Spencer" wrote: I'm not familiar with Cold Fusion, but I know it is similar to ASP. So, forgive me if I interpret you incorrectly, but it sure looks like your "cfinclude" tag is, in essence, a dynamic include file. If so, as ASP.Net is object-oriented, you would want to create a class instead, either a User Control (if you want to use a template) or a Server Control (which is a pure class), and conditionally create an instance of it and place it in your page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:89**********************************@microsof t.com... Trying to achieve this functionality in ASP.NET. <cfif NOT session.loggedin> <cfinclude template="loginPage.cfm"> <cfelse> <cfif session.loginType EQ "Instructor"> ... show Instructor menu... <cfif form.menuItem EQ 1> <cfinclude template="MenuItem1Page.cfm"> <cfelseif form.menuItem EQ 2> ....... </cfif> <cfelseif session.loginType EQ "Reviewer"> ... show Reviewer menu ... ... includes for Reviewers </cfif> </cfif> Trying nested master pages but having trouble implementing the nesting (Whidbey beta 1). Also not sure how to navigate between NOT logged in and logged in and among menuItem pages. Thanks in advance.
I really don't think you want nested pages. What you want is a User Control
(which is almost like a Page, but is designed to be used IN a page), or a
Server Control. Or you may want to do a Response.Redirect or a
Server.Transfer to a differrent page.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com... Thanks, Kevn. You inferred correctly re Cold Fusion. I think a structure like this would work - pseudocode: Main.master (<html><links><meta> etc.) if not logged in then LoginRoutine.aspx elseif login successful then if user is Instructor then Instructor.master (containing menu options) InstructorFunction_1.aspx ...... InstructorFunction_N.aspx elseif user is Reviewer then Reviewer.master (containing reviewer menu options) ReviewerFuntion_1.aspx .... ReviewerFuntion_N.aspx endif endif
I think I've figured out the basic plumbing of nested masters since my original post. But still not sure of best way to transfer from page to page. Have been doing the following which seems to work but it's unappealing:
httpContext.Current.Response.Redirect(xxx.aspx) in a content page's Load_Page method.
Is there a better way?
"Kevin Spencer" wrote:
I'm not familiar with Cold Fusion, but I know it is similar to ASP. So, forgive me if I interpret you incorrectly, but it sure looks like your "cfinclude" tag is, in essence, a dynamic include file. If so, as ASP.Net is object-oriented, you would want to create a class instead, either a User Control (if you want to use a template) or a Server Control (which is a pure class), and conditionally create an instance of it and place it in your page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:89**********************************@microsof t.com... > Trying to achieve this functionality in ASP.NET. > <cfif NOT session.loggedin> > <cfinclude template="loginPage.cfm"> > <cfelse> > <cfif session.loginType EQ "Instructor"> > ... show Instructor menu... > <cfif form.menuItem EQ 1> > <cfinclude template="MenuItem1Page.cfm"> > <cfelseif form.menuItem EQ 2> > ....... > </cfif> > <cfelseif session.loginType EQ "Reviewer"> > ... show Reviewer menu ... > ... includes for Reviewers > </cfif> > </cfif> > Trying nested master pages but having trouble implementing the nesting > (Whidbey beta 1). Also not sure how to navigate between NOT logged in > and > logged in and among menuItem pages. Thanks in advance.
Thanks, Kevin.
I guess you mean something like this schematically:
InstructorFunctions.aspx with these:
User control ID = menu
User control ID = InstructorFunction_1 (Invoked conditionally)
User control ID = InstructorFunction_2 (Invoked conditionally)
....
User control ID = InstructorFunction_1 (Invoked conditionally)
I'll try this.
"Kevin Spencer" wrote: I really don't think you want nested pages. What you want is a User Control (which is almost like a Page, but is designed to be used IN a page), or a Server Control. Or you may want to do a Response.Redirect or a Server.Transfer to a differrent page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:1C**********************************@microsof t.com... Thanks, Kevn. You inferred correctly re Cold Fusion. I think a structure like this would work - pseudocode: Main.master (<html><links><meta> etc.) if not logged in then LoginRoutine.aspx elseif login successful then if user is Instructor then Instructor.master (containing menu options) InstructorFunction_1.aspx ...... InstructorFunction_N.aspx elseif user is Reviewer then Reviewer.master (containing reviewer menu options) ReviewerFuntion_1.aspx .... ReviewerFuntion_N.aspx endif endif
I think I've figured out the basic plumbing of nested masters since my original post. But still not sure of best way to transfer from page to page. Have been doing the following which seems to work but it's unappealing:
httpContext.Current.Response.Redirect(xxx.aspx) in a content page's Load_Page method.
Is there a better way?
"Kevin Spencer" wrote:
I'm not familiar with Cold Fusion, but I know it is similar to ASP. So, forgive me if I interpret you incorrectly, but it sure looks like your "cfinclude" tag is, in essence, a dynamic include file. If so, as ASP.Net is object-oriented, you would want to create a class instead, either a User Control (if you want to use a template) or a Server Control (which is a pure class), and conditionally create an instance of it and place it in your page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:89**********************************@microsof t.com... > Trying to achieve this functionality in ASP.NET. > <cfif NOT session.loggedin> > <cfinclude template="loginPage.cfm"> > <cfelse> > <cfif session.loginType EQ "Instructor"> > ... show Instructor menu... > <cfif form.menuItem EQ 1> > <cfinclude template="MenuItem1Page.cfm"> > <cfelseif form.menuItem EQ 2> > ....... > </cfif> > <cfelseif session.loginType EQ "Reviewer"> > ... show Reviewer menu ... > ... includes for Reviewers > </cfif> > </cfif> > Trying nested master pages but having trouble implementing the nesting > (Whidbey beta 1). Also not sure how to navigate between NOT logged in > and > logged in and among menuItem pages. Thanks in advance.
Hi Peter,
That looks about right to me! :)
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com... Thanks, Kevin. I guess you mean something like this schematically: InstructorFunctions.aspx with these: User control ID = menu User control ID = InstructorFunction_1 (Invoked conditionally) User control ID = InstructorFunction_2 (Invoked conditionally) .... User control ID = InstructorFunction_1 (Invoked conditionally)
I'll try this.
"Kevin Spencer" wrote:
I really don't think you want nested pages. What you want is a User Control (which is almost like a Page, but is designed to be used IN a page), or a Server Control. Or you may want to do a Response.Redirect or a Server.Transfer to a differrent page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:1C**********************************@microsof t.com... > Thanks, Kevn. You inferred correctly re Cold Fusion. I think a > structure > like this would work - pseudocode: > Main.master (<html><links><meta> etc.) > if not logged in then > LoginRoutine.aspx > elseif login successful then > if user is Instructor then > Instructor.master (containing menu options) > InstructorFunction_1.aspx > ...... > InstructorFunction_N.aspx > elseif user is Reviewer then > Reviewer.master (containing reviewer menu options) > ReviewerFuntion_1.aspx > .... > ReviewerFuntion_N.aspx > endif > endif > > I think I've figured out the basic plumbing of nested masters since my > original post. > But still not sure of best way to transfer from page to page. Have > been > doing the following which seems to work but it's unappealing: > > httpContext.Current.Response.Redirect(xxx.aspx) in a content page's > Load_Page method. > > Is there a better way? > > "Kevin Spencer" wrote: > >> I'm not familiar with Cold Fusion, but I know it is similar to ASP. >> So, >> forgive me if I interpret you incorrectly, but it sure looks like your >> "cfinclude" tag is, in essence, a dynamic include file. If so, as >> ASP.Net >> is >> object-oriented, you would want to create a class instead, either a >> User >> Control (if you want to use a template) or a Server Control (which is >> a >> pure >> class), and conditionally create an instance of it and place it in >> your >> page. >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> ..Net Developer >> Ambiguity has a certain quality to it. >> >> "Peter" <Pe***@discussions.microsoft.com> wrote in message >> news:89**********************************@microsof t.com... >> > Trying to achieve this functionality in ASP.NET. >> > <cfif NOT session.loggedin> >> > <cfinclude template="loginPage.cfm"> >> > <cfelse> >> > <cfif session.loginType EQ "Instructor"> >> > ... show Instructor menu... >> > <cfif form.menuItem EQ 1> >> > <cfinclude template="MenuItem1Page.cfm"> >> > <cfelseif form.menuItem EQ 2> >> > ....... >> > </cfif> >> > <cfelseif session.loginType EQ "Reviewer"> >> > ... show Reviewer menu ... >> > ... includes for Reviewers >> > </cfif> >> > </cfif> >> > Trying nested master pages but having trouble implementing the >> > nesting >> > (Whidbey beta 1). Also not sure how to navigate between NOT logged >> > in >> > and >> > logged in and among menuItem pages. Thanks in advance. >> >> >>
Hi Peter,
Also, if you're using User Controls, be aware that they CAN be conditionally
loaded (that is, not be in the Page Template, but loaded into the Page at
run-time). This is done by using the Page.LoadControl() method.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com... Thanks, Kevin. I guess you mean something like this schematically: InstructorFunctions.aspx with these: User control ID = menu User control ID = InstructorFunction_1 (Invoked conditionally) User control ID = InstructorFunction_2 (Invoked conditionally) .... User control ID = InstructorFunction_1 (Invoked conditionally)
I'll try this.
"Kevin Spencer" wrote:
I really don't think you want nested pages. What you want is a User Control (which is almost like a Page, but is designed to be used IN a page), or a Server Control. Or you may want to do a Response.Redirect or a Server.Transfer to a differrent page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:1C**********************************@microsof t.com... > Thanks, Kevn. You inferred correctly re Cold Fusion. I think a > structure > like this would work - pseudocode: > Main.master (<html><links><meta> etc.) > if not logged in then > LoginRoutine.aspx > elseif login successful then > if user is Instructor then > Instructor.master (containing menu options) > InstructorFunction_1.aspx > ...... > InstructorFunction_N.aspx > elseif user is Reviewer then > Reviewer.master (containing reviewer menu options) > ReviewerFuntion_1.aspx > .... > ReviewerFuntion_N.aspx > endif > endif > > I think I've figured out the basic plumbing of nested masters since my > original post. > But still not sure of best way to transfer from page to page. Have > been > doing the following which seems to work but it's unappealing: > > httpContext.Current.Response.Redirect(xxx.aspx) in a content page's > Load_Page method. > > Is there a better way? > > "Kevin Spencer" wrote: > >> I'm not familiar with Cold Fusion, but I know it is similar to ASP. >> So, >> forgive me if I interpret you incorrectly, but it sure looks like your >> "cfinclude" tag is, in essence, a dynamic include file. If so, as >> ASP.Net >> is >> object-oriented, you would want to create a class instead, either a >> User >> Control (if you want to use a template) or a Server Control (which is >> a >> pure >> class), and conditionally create an instance of it and place it in >> your >> page. >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> ..Net Developer >> Ambiguity has a certain quality to it. >> >> "Peter" <Pe***@discussions.microsoft.com> wrote in message >> news:89**********************************@microsof t.com... >> > Trying to achieve this functionality in ASP.NET. >> > <cfif NOT session.loggedin> >> > <cfinclude template="loginPage.cfm"> >> > <cfelse> >> > <cfif session.loginType EQ "Instructor"> >> > ... show Instructor menu... >> > <cfif form.menuItem EQ 1> >> > <cfinclude template="MenuItem1Page.cfm"> >> > <cfelseif form.menuItem EQ 2> >> > ....... >> > </cfif> >> > <cfelseif session.loginType EQ "Reviewer"> >> > ... show Reviewer menu ... >> > ... includes for Reviewers >> > </cfif> >> > </cfif> >> > Trying nested master pages but having trouble implementing the >> > nesting >> > (Whidbey beta 1). Also not sure how to navigate between NOT logged >> > in >> > and >> > logged in and among menuItem pages. Thanks in advance. >> >> >>
Got it! Have the menu working now as user control. With ViewState enabled,
using
Page_Load()
{
if(!IsPostBack)
{
... add menu items here ...
}
}
Love the tip on Page.LoadControl().
Thanks,
Peter
"Kevin Spencer" wrote: Hi Peter,
Also, if you're using User Controls, be aware that they CAN be conditionally loaded (that is, not be in the Page Template, but loaded into the Page at run-time). This is done by using the Page.LoadControl() method.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:BB**********************************@microsof t.com... Thanks, Kevin. I guess you mean something like this schematically: InstructorFunctions.aspx with these: User control ID = menu User control ID = InstructorFunction_1 (Invoked conditionally) User control ID = InstructorFunction_2 (Invoked conditionally) .... User control ID = InstructorFunction_1 (Invoked conditionally)
I'll try this.
"Kevin Spencer" wrote:
I really don't think you want nested pages. What you want is a User Control (which is almost like a Page, but is designed to be used IN a page), or a Server Control. Or you may want to do a Response.Redirect or a Server.Transfer to a differrent page.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it.
"Peter" <Pe***@discussions.microsoft.com> wrote in message news:1C**********************************@microsof t.com... > Thanks, Kevn. You inferred correctly re Cold Fusion. I think a > structure > like this would work - pseudocode: > Main.master (<html><links><meta> etc.) > if not logged in then > LoginRoutine.aspx > elseif login successful then > if user is Instructor then > Instructor.master (containing menu options) > InstructorFunction_1.aspx > ...... > InstructorFunction_N.aspx > elseif user is Reviewer then > Reviewer.master (containing reviewer menu options) > ReviewerFuntion_1.aspx > .... > ReviewerFuntion_N.aspx > endif > endif > > I think I've figured out the basic plumbing of nested masters since my > original post. > But still not sure of best way to transfer from page to page. Have > been > doing the following which seems to work but it's unappealing: > > httpContext.Current.Response.Redirect(xxx.aspx) in a content page's > Load_Page method. > > Is there a better way? > > "Kevin Spencer" wrote: > >> I'm not familiar with Cold Fusion, but I know it is similar to ASP. >> So, >> forgive me if I interpret you incorrectly, but it sure looks like your >> "cfinclude" tag is, in essence, a dynamic include file. If so, as >> ASP.Net >> is >> object-oriented, you would want to create a class instead, either a >> User >> Control (if you want to use a template) or a Server Control (which is >> a >> pure >> class), and conditionally create an instance of it and place it in >> your >> page. >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> ..Net Developer >> Ambiguity has a certain quality to it. >> >> "Peter" <Pe***@discussions.microsoft.com> wrote in message >> news:89**********************************@microsof t.com... >> > Trying to achieve this functionality in ASP.NET. >> > <cfif NOT session.loggedin> >> > <cfinclude template="loginPage.cfm"> >> > <cfelse> >> > <cfif session.loginType EQ "Instructor"> >> > ... show Instructor menu... >> > <cfif form.menuItem EQ 1> >> > <cfinclude template="MenuItem1Page.cfm"> >> > <cfelseif form.menuItem EQ 2> >> > ....... >> > </cfif> >> > <cfelseif session.loginType EQ "Reviewer"> >> > ... show Reviewer menu ... >> > ... includes for Reviewers >> > </cfif> >> > </cfif> >> > Trying nested master pages but having trouble implementing the >> > nesting >> > (Whidbey beta 1). Also not sure how to navigate between NOT logged >> > in >> > and >> > logged in and among menuItem pages. Thanks in advance. >> >> >> This discussion thread is closed Replies have been disabled for this discussion. Similar topics
2 posts
views
Thread by Vikas |
last post: by
|
2 posts
views
Thread by Tom |
last post: by
|
25 posts
views
Thread by KK |
last post: by
|
reply
views
Thread by blongmire |
last post: by
|
reply
views
Thread by rellik |
last post: by
|
1 post
views
Thread by Srini |
last post: by
|
11 posts
views
Thread by MadMonk |
last post: by
|
1 post
views
Thread by Monty |
last post: by
| | | | | | | | | | | |