Display text on Home/Default page using external .inc file

rated by 0 users
Not Answered This post has 0 verified answers | 2 Replies | 2 Followers

Not Ranked
1 Posts
Points 35
BrianClo posted on Fri, Jun 13 2008 6:41 AM

I'm trying to add a section on my homepage/default.aspx page containing Recent News which I want to be dynamic, using an external .inc file. The reason I'm doing this is I don't want to update the default page on a regular basis.

 

I've added a table on the home/default page with the following code <!-- #include virtual ="whatsnew.inc"--> and have placed the whatsnew.inc file in the same folder as the default.aspx file but nothing is displaying. Am I on the right track - maybe someone can give me some pointers?

 

All Replies

Top 500 Contributor
50 Posts
Points 715

ASP.NET doesn't use include pages. We could get into a whole bunch of talk about the right terminology but we'll leave that for others to discuss.

You need to create a user control - ascx filetype and reference it on your home.aspx page. Community Server uses them on the Master.Master page for the Ad-Top and Ad-Bottom user controls.

If looking at within CS doesn't help here is a link that may help you on your way - http://www.asp101.com/lessons/usercontrols.asp

 

thwack.com - SolarWinds

  • | Post Points: 5
Top 500 Contributor
50 Posts
Points 715

I thought I posted this a while ago, sorry if it didn't make it up here.

 

Include files aren't available in ASP.NET instead you use User Control - ascx files.

 

You can see them in action in your master.Master page for AD-Top and Ad-Bottom user controls. This should help you accomplish what you are trying to do.

 

Randy

thwack.com - SolarWinds

  • | Post Points: 5
Page 1 of 1 (3 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com