Click here to Skip to main content
15,901,373 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to open a new broswer with new URL Pin
Mike Ellison27-Apr-06 2:42
Mike Ellison27-Apr-06 2:42 
QuestionDeployment Pin
NICE TO MEET26-Apr-06 17:49
NICE TO MEET26-Apr-06 17:49 
GeneralRe: Deployment Pin
J4amieC26-Apr-06 22:10
J4amieC26-Apr-06 22:10 
QuestionHow to refresh a bound control Pin
2hdass26-Apr-06 17:02
2hdass26-Apr-06 17:02 
AnswerRe: How to refresh a bound control Pin
minhpc_bk26-Apr-06 17:25
minhpc_bk26-Apr-06 17:25 
QuestionASP.net Insert Variable Pin
aurora8326-Apr-06 13:08
aurora8326-Apr-06 13:08 
AnswerRe: ASP.net Insert Variable Pin
Mike Ellison26-Apr-06 13:37
Mike Ellison26-Apr-06 13:37 
AnswerRe: ASP.net Insert Variable Pin
Mike Ellison26-Apr-06 14:04
Mike Ellison26-Apr-06 14:04 
Just to flesh out my earlier suggestion with a sample - here would be a web form dynamicHeader.aspx, using the custom control -
<%@ Page Language="C#" %>
<%@ Register TagPrefix="site" TagName="content" Src="dynamicHeader.ascx" %>

<html>
  <head>
    <title></title>
  </head>

  <body>
    <form runat="server">
    
        <site:content runat="server" />
        
        <p>
          blah blah blah blah blah blah blah 
          blah blah blah blah blah blah blah 
          blah blah blah blah blah blah blah 
          blah blah blah blah blah blah blah 
          blah blah blah blah blah blah blah 
          blah blah blah blah blah blah blah 
          blah blah blah blah blah blah blah 
        </p>

    </form>
  </body>

</html>
Then this could be the definition of dynamicHeader.ascx:
<%@ Control Language="C#" %>
<%@ Import Namespace="System.Web.Configuration" %>

<script runat="server">
    void Page_Load()
    {
        // load a user control; get this from AppSettings
        string controlToLoad 
          = WebConfigurationManager.AppSettings["HeaderControl"];
        
        Control uc = LoadControl(controlToLoad);
        PlaceHolder1.Controls.Add(uc);

    }
</script>

<asp:PlaceHolder id="PlaceHolder1" runat="server" />
Here are two user controls then, header1.ascx and header2.ascx:
<%@ Control Language="C#" %>

<h3>This is Header1.ascx</h3>
<asp:TextBox runat="server" />
<asp:Button runat="server" text="Search" />
<hr />
<%@ Control Language="C#" %>

<h3>This is Header2.ascx</h3>
<asp:Calendar runat="server" />
<hr />
And finally, you could then add either "header1.ascx" or "header2.ascx" in your web.config file:
<configuration>
    <appSettings>
        <add key="HeaderControl" value="header2.ascx" />
    </appSettings>
</configuration>
Does this help?
QuestionService Requisition System Pin
ashortega26-Apr-06 12:02
ashortega26-Apr-06 12:02 
AnswerRe: Service Requisition System Pin
Mike Ellison26-Apr-06 12:27
Mike Ellison26-Apr-06 12:27 
QuestionASP.NET source code for Inventory management system Pin
cena_rock26-Apr-06 10:08
cena_rock26-Apr-06 10:08 
GeneralRe: ASP.NET source code for Inventory management system Pin
Guffa26-Apr-06 10:27
Guffa26-Apr-06 10:27 
QuestionCrystal reports Pin
Jmshastri26-Apr-06 8:09
Jmshastri26-Apr-06 8:09 
AnswerRe: Crystal reports Pin
minhpc_bk26-Apr-06 17:20
minhpc_bk26-Apr-06 17:20 
GeneralRe: Crystal reports Pin
Jmshastri26-Apr-06 22:46
Jmshastri26-Apr-06 22:46 
GeneralRe: Crystal reports Pin
minhpc_bk27-Apr-06 0:27
minhpc_bk27-Apr-06 0:27 
GeneralRe: Crystal reports Pin
Dinuj Nath27-Apr-06 0:49
Dinuj Nath27-Apr-06 0:49 
Questionsession and application expires Pin
vijnathan26-Apr-06 7:35
vijnathan26-Apr-06 7:35 
AnswerRe: session and application expires Pin
minhpc_bk26-Apr-06 17:14
minhpc_bk26-Apr-06 17:14 
QuestionDigital Dashboard Pin
boriz_spider26-Apr-06 6:28
boriz_spider26-Apr-06 6:28 
AnswerRe: Digital Dashboard Pin
Richard Parsons26-Apr-06 10:30
Richard Parsons26-Apr-06 10:30 
GeneralRe: Digital Dashboard Pin
boriz_spider27-Apr-06 6:34
boriz_spider27-Apr-06 6:34 
GeneralRe: Digital Dashboard Pin
Alexander Chiang27-Apr-06 11:34
Alexander Chiang27-Apr-06 11:34 
QuestionOpen Popup window without using Javascript Pin
Ashutosh_Agarwal26-Apr-06 5:20
Ashutosh_Agarwal26-Apr-06 5:20 
AnswerRe: Open Popup window without using Javascript Pin
J4amieC26-Apr-06 5:49
J4amieC26-Apr-06 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.