Showing posts with label master. Show all posts
Showing posts with label master. Show all posts

Monday, March 26, 2012

newbie: Master pages... dynamic content...

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----
| Title |
----
| | button navigation bar |
| | ---|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---
Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)
The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).
The question is can i display different web forms in the content part
when the menu is clicked?
I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?You have some incorrect notions.
Master pages can have dynamic content. The isue is they are a little harder
to ahve the page update master page content, but it is not impossible. And,
if you have the master page render dynamically, there is no issue. I see no
reason why a user driven menu cannot be placed in a master page.
If you use master pages, the different content is fairly easy. If not, you
will need another option. DotNet Nuke is an option and would be easier than
rolling your own.
Third choice, way out in left field, is to create your own engine to render
the pages. I would inherit from page to do this, as you can have your class
handle most of the lifting. User controls are also an option for content, if
you wish to use a model-view-controller type of set up. I would shy away
from any of these choices, esp. as a rookie, unless the master pages and
DotNet Nuke fail to work.
NOTE: Check out the starter kits under downloads at www.asp.net. They will
give you a good framework to start from.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
****
Think outside the box!
****************************************
****
"celoftis" <celoftis@.gmail.com> wrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegroups.com...
> Using VS2005, VB codebehind,
> I'm porting a windows app to the web - My main page is very simple and
> will look something like this:
> ----
> | Title |
> ----
> | | button navigation bar |
> | | ---|
> | | |
> | Menu| |
> | | Content |
> | | |
> | | |
> | | |
> ---
> Menu is a treeview control that is (potientially) different for each
> user that visits the site. (nodes are dynamically populated in the
> treeview via code behind based on user's role and auth. level)
> The Content can be any object renderable by a browser (HTM, flash, pdf,
> office document, etc).
> The question is can i display different web forms in the content part
> when the menu is clicked?
> I've looked at master pages but from what I understand they would only
> be able to display HTM in the "Content" area. Does anyone have any
> ideas on how to allow the content area to display other types of
> objects?
> Can anyone help a web rookie ?
>
I have a treeview in a master page, and I display pdf files(EKGs and X-Rays)
in the content pages using an <embed> tag. The 'src' attribute of the embed
tag is assigned when the content page loads based on the query string used
to open the content page when a treeview node is clicked.
"celoftis" <celoftis@.gmail.com> wrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegroups.com...
> Using VS2005, VB codebehind,
> I'm porting a windows app to the web - My main page is very simple and
> will look something like this:
> ----
> | Title |
> ----
> | | button navigation bar |
> | | ---|
> | | |
> | Menu| |
> | | Content |
> | | |
> | | |
> | | |
> ---
> Menu is a treeview control that is (potientially) different for each
> user that visits the site. (nodes are dynamically populated in the
> treeview via code behind based on user's role and auth. level)
> The Content can be any object renderable by a browser (HTM, flash, pdf,
> office document, etc).
> The question is can i display different web forms in the content part
> when the menu is clicked?
> I've looked at master pages but from what I understand they would only
> be able to display HTM in the "Content" area. Does anyone have any
> ideas on how to allow the content area to display other types of
> objects?
> Can anyone help a web rookie ?
>
Gregory,
Thanks for the reply. I'm excited at the possibility of making this
work.
I've got hundreds (if not a thousand) content pages that I need to be
target for the "child page". Problem is I don't want to modify all
the pages - in fact, the majority of the pages are on remote servers
that I have no access to - so I really just need to be able to point
to a URL and have it load in the child page. Can I still use master
pages to make this work?
I've reviewed ASP.NET downloads haven't found anything that suits my
situation - any other pointer or code snippets would be greatly
appreciated! Please Let me know what you think either way.
celoftis
Thanks... I'll keep that in mind.
The content inside a 'child page' needs to be inside a ContentPlaceHolderID
control. Also - the page needs to have the .aspx extension and have a
reference at the top of that content page, to the master page.
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"celoftis" <celoftis@.gmail.com> wrote in message
news:1168447380.383686.248680@.i56g2000hsf.googlegroups.com...
> Gregory,
> Thanks for the reply. I'm excited at the possibility of making this
> work.
> I've got hundreds (if not a thousand) content pages that I need to be
> target for the "child page". Problem is I don't want to modify all
> the pages - in fact, the majority of the pages are on remote servers
> that I have no access to - so I really just need to be able to point
> to a URL and have it load in the child page. Can I still use master
> pages to make this work?
> I've reviewed ASP.NET downloads haven't found anything that suits my
> situation - any other pointer or code snippets would be greatly
> appreciated! Please Let me know what you think either way.
> celoftis
>
David,
Thanks for the reply...
So, for my specifc situation (not being able to access all the content
pages), it looks like master pages are not going to work - do you
agree?
But if I could modify the content of all the child pages, then I could
use a script to wrap the existing page(s) with
ContentPlaceHolderID(s)... seems real messy.

newbie: Master pages... dynamic content...

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----------------
| Title |
----------------
| | button navigation bar |
| | ------------|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---------------

Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)

The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).

The question is can i display different web forms in the content part
when the menu is clicked?

I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?You have some incorrect notions.

Master pages can have dynamic content. The isue is they are a little harder
to ahve the page update master page content, but it is not impossible. And,
if you have the master page render dynamically, there is no issue. I see no
reason why a user driven menu cannot be placed in a master page.

If you use master pages, the different content is fairly easy. If not, you
will need another option. DotNet Nuke is an option and would be easier than
rolling your own.

Third choice, way out in left field, is to create your own engine to render
the pages. I would inherit from page to do this, as you can have your class
handle most of the lifting. User controls are also an option for content, if
you wish to use a model-view-controller type of set up. I would shy away
from any of these choices, esp. as a rookie, unless the master pages and
DotNet Nuke fail to work.

NOTE: Check out the starter kits under downloads at www.asp.net. They will
give you a good framework to start from.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
********************************************
Think outside the box!
********************************************
"celoftis" <celoftis@.gmail.comwrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegrou ps.com...

Quote:

Originally Posted by

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----------------
| Title |
----------------
| | button navigation bar |
| | ------------|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---------------
>
Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)
>
The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).
>
The question is can i display different web forms in the content part
when the menu is clicked?
>
I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?
>


I have a treeview in a master page, and I display pdf files(EKGs and X-Rays)
in the content pages using an <embedtag. The 'src' attribute of the embed
tag is assigned when the content page loads based on the query string used
to open the content page when a treeview node is clicked.

"celoftis" <celoftis@.gmail.comwrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegrou ps.com...

Quote:

Originally Posted by

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----------------
| Title |
----------------
| | button navigation bar |
| | ------------|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---------------
>
Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)
>
The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).
>
The question is can i display different web forms in the content part
when the menu is clicked?
>
I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?
>


Gregory,
Thanks for the reply. I'm excited at the possibility of making this
work.
I've got hundreds (if not a thousand) content pages that I need to be
target for the "child page". Problem is I don't want to modify all
the pages - in fact, the majority of the pages are on remote servers
that I have no access to - so I really just need to be able to point
to a URL and have it load in the child page. Can I still use master
pages to make this work?

I've reviewed ASP.NET downloads haven't found anything that suits my
situation - any other pointer or code snippets would be greatly
appreciated! Please Let me know what you think either way.

celoftis
Thanks... I'll keep that in mind.
The content inside a 'child page' needs to be inside a ContentPlaceHolderID
control. Also - the page needs to have the .aspx extension and have a
reference at the top of that content page, to the master page.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"celoftis" <celoftis@.gmail.comwrote in message
news:1168447380.383686.248680@.i56g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

Gregory,
Thanks for the reply. I'm excited at the possibility of making this
work.
I've got hundreds (if not a thousand) content pages that I need to be
target for the "child page". Problem is I don't want to modify all
the pages - in fact, the majority of the pages are on remote servers
that I have no access to - so I really just need to be able to point
to a URL and have it load in the child page. Can I still use master
pages to make this work?
>
I've reviewed ASP.NET downloads haven't found anything that suits my
situation - any other pointer or code snippets would be greatly
appreciated! Please Let me know what you think either way.
>
celoftis
>


David,
Thanks for the reply...

So, for my specifc situation (not being able to access all the content
pages), it looks like master pages are not going to work - do you
agree?

But if I could modify the content of all the child pages, then I could
use a script to wrap the existing page(s) with
ContentPlaceHolderID(s)... seems real messy.

newbie: problem with master pages!

Hey
I'm creating a simple helloworld project in visual web developer 2005
express
In my my project I've created a simple master page, that contains 1 table (3
rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is placed
at row 2, column 2 (that means it's in the centre cell in the table)...
After creating the master mage, I then created a new web page that uses this
master page. In this web page I added a calendar. But my PROBLEM occur when
I run this website, the calendar is then placed a bit offset to the
left..See this link, and you see what I mean:
http://home.online.no/~au-holme/pub/66404/ (I'm using those different colors
to see where all the table cells goes) As mentioned above the
contentplaceholder is in the second row, seconds column.. but here the
contentplaceholder uses parts of column 1...
I want contentplaceholder to be in column 2, row 2, not like this (column 2
+ COLUMN 1, row 2)
What am I doing wrong here?
Maybe it's a bad idea to position contentplaceholder using tables?
Maybe Panel should be used instead for position contentplaceholder?
Best Regards
JeffLearn CSS Jeff. It solves all these problems but note if you are using
Themes or StyleSheetThemes with your MasterPage.
For now try to wrap your calendar in a div and play with the margin
values...
<div style="margin: .25em .25em .25em .25em">
<asp:Calendar ... />
</div>
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23iTacEhmGHA.3732@.TK2MSFTNGP05.phx.gbl...
> Hey
> I'm creating a simple helloworld project in visual web developer 2005
> express
> In my my project I've created a simple master page, that contains 1 table
> (3 rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is
> placed at row 2, column 2 (that means it's in the centre cell in the
> table)...
> After creating the master mage, I then created a new web page that uses
> this master page. In this web page I added a calendar. But my PROBLEM
> occur when I run this website, the calendar is then placed a bit offset to
> the left..See this link, and you see what I mean:
> http://home.online.no/~au-holme/pub/66404/ (I'm using those different
> colors to see where all the table cells goes) As mentioned above the
> contentplaceholder is in the second row, seconds column.. but here the
> contentplaceholder uses parts of column 1...
> I want contentplaceholder to be in column 2, row 2, not like this (column
> 2 + COLUMN 1, row 2)
> What am I doing wrong here?
> Maybe it's a bad idea to position contentplaceholder using tables?
> Maybe Panel should be used instead for position contentplaceholder?
> Best Regards
> Jeff
>

newbie: problem with master pages!

Hey

I'm creating a simple helloworld project in visual web developer 2005
express

In my my project I've created a simple master page, that contains 1 table (3
rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is placed
at row 2, column 2 (that means it's in the centre cell in the table)...

After creating the master mage, I then created a new web page that uses this
master page. In this web page I added a calendar. But my PROBLEM occur when
I run this website, the calendar is then placed a bit offset to the
left..See this link, and you see what I mean:
http://home.online.no/~au-holme/pub/66404/ (I'm using those different colors
to see where all the table cells goes) As mentioned above the
contentplaceholder is in the second row, seconds column.. but here the
contentplaceholder uses parts of column 1...

I want contentplaceholder to be in column 2, row 2, not like this (column 2
+ COLUMN 1, row 2)

What am I doing wrong here?

Maybe it's a bad idea to position contentplaceholder using tables?

Maybe Panel should be used instead for position contentplaceholder?

Best Regards

JeffLearn CSS Jeff. It solves all these problems but note if you are using
Themes or StyleSheetThemes with your MasterPage.

For now try to wrap your calendar in a div and play with the margin
values...

<div style="margin: .25em .25em .25em .25em">
<asp:Calendar ... />
</div
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23iTacEhmGHA.3732@.TK2MSFTNGP05.phx.gbl...
> Hey
> I'm creating a simple helloworld project in visual web developer 2005
> express
> In my my project I've created a simple master page, that contains 1 table
> (3 rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is
> placed at row 2, column 2 (that means it's in the centre cell in the
> table)...
> After creating the master mage, I then created a new web page that uses
> this master page. In this web page I added a calendar. But my PROBLEM
> occur when I run this website, the calendar is then placed a bit offset to
> the left..See this link, and you see what I mean:
> http://home.online.no/~au-holme/pub/66404/ (I'm using those different
> colors to see where all the table cells goes) As mentioned above the
> contentplaceholder is in the second row, seconds column.. but here the
> contentplaceholder uses parts of column 1...
> I want contentplaceholder to be in column 2, row 2, not like this (column
> 2 + COLUMN 1, row 2)
> What am I doing wrong here?
> Maybe it's a bad idea to position contentplaceholder using tables?
> Maybe Panel should be used instead for position contentplaceholder?
> Best Regards
> Jeff

Saturday, March 24, 2012

newbie: this is a strange phenomenon

hey

asp.net 2.0

I've created a master page with 2 ContentPlaceHolders (named "sidebar" and
"content"):
<table style="z-index: 100; left: 12px; width: 100%; position: absolute;
top: 113px;">
<tr>
<td rowspan="3" style="width: 158px" valign="top">
<asp:ContentPlaceHolder ID="sidebar" runat="server">
</asp:ContentPlaceHolder>
</td>
<td style="width: 688px" bgcolor="#f7f6f3" valign="top" >
<asp:ContentPlaceHolder ID="content" runat="server">
</asp:ContentPlaceHolder>
</td>
<td style="width: 223px">
</td>
</tr>
</table>

Then I've created a webpage based on this master page...

Now I start to add a label control to the default.aspx webpage (based on the
master mention above). I select the Label control in the toolbox and drag it
over to the content (ContentPlaceHolder). I see that the border arround the
content control flashes a blue color telling that this control will be
dropped on this content place holder... But when I dropp this control on
this contentplaceholder (default.aspx) the control appear on the other
contentPlaceHolder (sidebar)

Any ideas what I'm doing wrong here?

JeffHi Jeff,

Is it because you're using absolute positioning in the master page and not
in the content page?

Ken
Microsoft MVP [ASP.NET]

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:er%23%23Cz1pGHA.4408@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

hey
>
asp.net 2.0
>
I've created a master page with 2 ContentPlaceHolders (named "sidebar" and
"content"):
<table style="z-index: 100; left: 12px; width: 100%; position: absolute;
top: 113px;">
<tr>
<td rowspan="3" style="width: 158px" valign="top">
<asp:ContentPlaceHolder ID="sidebar" runat="server">
</asp:ContentPlaceHolder>
</td>
<td style="width: 688px" bgcolor="#f7f6f3" valign="top" >
<asp:ContentPlaceHolder ID="content" runat="server">
</asp:ContentPlaceHolder>
</td>
<td style="width: 223px">
</td>
</tr>
</table>
>
>
Then I've created a webpage based on this master page...
>
Now I start to add a label control to the default.aspx webpage (based on
the master mention above). I select the Label control in the toolbox and
drag it over to the content (ContentPlaceHolder). I see that the border
arround the content control flashes a blue color telling that this control
will be dropped on this content place holder... But when I dropp this
control on this contentplaceholder (default.aspx) the control appear on
the other contentPlaceHolder (sidebar)
>
Any ideas what I'm doing wrong here?
>
Jeff
>
>