1

I was thinking of creating a button for a site, which dynamically creates support pages with the CMS control...blank ones so the don't need to have us create like 12 or more and then deploy and such i had a solution where i would basically copy one of the support pages and rename it and place it in the SitePages folder...so the end result will be that subsequent pages created this way will share the same codebehind file...which eleminates the requirement for a build and compile on each page creation. this works on my local box and on staging...because the codebase there isn't precompiled...on production however, the code is precompiled and thus this solution basically doesn't work...

Does any1 has any idea on how to proceed?

Regards, Gautam

3
  • You can create a single master page and load dynamic content from your CMS. No need to create new page files. Commented Jun 13, 2012 at 14:43
  • I actually need to add different pages with CMS control on each of the page. Commented Jun 13, 2012 at 14:52
  • Right, you can do that with a master page that has a CMS control at the top of the page. Commented Jun 13, 2012 at 14:54

3 Answers 3

1

Add control to page dynamically : www.asp.net/web-forms/videos/aspnet-ajax/how-to-dynamically-add-controls-to-a-web-page

Building asp.net pages dynamically : www.codeproject.com/Articles/25573/Building-ASP-NET-Web-Pages-Dynamically-in-the-Code

Sign up to request clarification or add additional context in comments.

Comments

0

when you precompile your page will refer a dll instead of cs.

<%@ page title="About Us" language="C#" masterpagefile="~/Site.master" autoeventwireup="true" inherits="About, App_Web_ad0b3bhg" %>

In the above example App_Web_ad0b3bhg is dll. when you create new file you need to take care of it. Provide your code snippet that will help us to correct it in order to accomodate this.

Comments

0

One way to acheive this is , that your aspx pages does not specify Inherits attribute.For the support aspx only pages you can define a base Page type in the config file like following

<pages  pageBaseType="typename, assembly">
</pages>

Where type name is your code behing type/class and assembly is the compiled assembly that contains the type. So all your pages where Inherits element is missing, it shall inherit from the config class.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.