Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > "Dynamic" include files?

Reply
Thread Tools

"Dynamic" include files?

 
 
Buddy Robbins
Guest
Posts: n/a
 
      01-31-2005
Hey folks,
I am re-writing an ASP.Net site for a company.
The client wants to be responsible for the static content and navigation of
their site, and I'll be responsible for any dynamic content.

I'm using Infragistics Ultra Web Navigator, which can load the menus from an
XML file, so the navigation requirement is taken care of.

I had created a generic aspx file that accepts the static content filename
as a query string. The ASPX form has a header user web control (containg
the menu control) and a footer user web control.
Between the two, I'm using a select statement based on the query string to
process the appropriate include file statements for the "guts" of the static
content.

This works fine right now, however, if the client wants to add new static
pages, the default.aspx file has to be edited to add the case for the new
web page.

This seems like a clunky way to do it, and I can't figure out how go
generate the include file line dynamically.

Could anyone point me in a direction that will accomplish this?


Thanks in advance,
-Buddy Robbins


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      01-31-2005
You could use Response.WriteFile, load content as an ASCX file etc...

Patrice

--

"Buddy Robbins" <(E-Mail Removed)> a écrit dans le message de
news:uAmX%(E-Mail Removed)...
> Hey folks,
> I am re-writing an ASP.Net site for a company.
> The client wants to be responsible for the static content and navigation

of
> their site, and I'll be responsible for any dynamic content.
>
> I'm using Infragistics Ultra Web Navigator, which can load the menus from

an
> XML file, so the navigation requirement is taken care of.
>
> I had created a generic aspx file that accepts the static content filename
> as a query string. The ASPX form has a header user web control (containg
> the menu control) and a footer user web control.
> Between the two, I'm using a select statement based on the query string to
> process the appropriate include file statements for the "guts" of the

static
> content.
>
> This works fine right now, however, if the client wants to add new static
> pages, the default.aspx file has to be edited to add the case for the new
> web page.
>
> This seems like a clunky way to do it, and I can't figure out how go
> generate the include file line dynamically.
>
> Could anyone point me in a direction that will accomplish this?
>
>
> Thanks in advance,
> -Buddy Robbins
>
>



 
Reply With Quote
 
 
 
 
Ben Miller [MSFT]
Guest
Posts: n/a
 
      02-03-2005
You will want to use the User Control way (ASCX). As you can take and use
the Page.LoadControl(stringFromQueryString + ".ascx") and add this control
to a placeholder.

<asplaceHolder id="place" runat="server" />

In code...

Sub Page_Load()

Dim somevar as string
If Request.QueryString("querystringvarname") Is Nothing Then
somevar = "somecontrolThatShowsError"
Else
somevar = Request.Querystring("querystringvarname")
End If

place.Controls.Add(Page.LoadControl(somevar & ".ascx"))

End Sub

HTH.
Ben Miller
This post is provided "AS IS" and the code samples express no liabilities or
warranties of any kind.

"Buddy Robbins" <(E-Mail Removed)> wrote in message
news:uAmX%(E-Mail Removed)...
> Hey folks,
> I am re-writing an ASP.Net site for a company.
> The client wants to be responsible for the static content and navigation
> of their site, and I'll be responsible for any dynamic content.
>
> I'm using Infragistics Ultra Web Navigator, which can load the menus from
> an XML file, so the navigation requirement is taken care of.
>
> I had created a generic aspx file that accepts the static content filename
> as a query string. The ASPX form has a header user web control (containg
> the menu control) and a footer user web control.
> Between the two, I'm using a select statement based on the query string to
> process the appropriate include file statements for the "guts" of the
> static content.
>
> This works fine right now, however, if the client wants to add new static
> pages, the default.aspx file has to be edited to add the case for the new
> web page.
>
> This seems like a clunky way to do it, and I can't figure out how go
> generate the include file line dynamically.
>
> Could anyone point me in a direction that will accomplish this?
>
>
> Thanks in advance,
> -Buddy Robbins
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
#include headers that include this header Aguilar, James C++ 2 07-16-2004 05:56 PM
Re: the use of #include <a_file.h> v/s #include"a_file.cpp" Elie Nader C++ 1 11-28-2003 03:12 PM
Re: the use of #include <a_file.h> v/s #include"a_file.cpp" Rolf Magnus C++ 2 11-28-2003 12:26 PM
#include "bar" negates #include <string> ; how to fix? Danny Anderson C++ 5 08-15-2003 06:38 PM



Advertisments