SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Aug 2004
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Encapulating a webapplication in a dll

    Attached is an image representing my current structure.

    The goal is to move all the user controls in administrator.robusthaven.com
    into the project robusthaven.components.knowledgebase.web

    the goal is to deploy my knowlegebase to any website by just including the dll.

    but a simple test called WebUserControl1 caused me problems.
    visual studio isn't connecting the ascx with the codebehind.

    simple test:

    PHP Code:
    <&#37;@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs"  Inherits="RobustHaven.Components.KnowledgeBase.Web.WebUserControl1" %>
    <asp:Button ID="Button1" runat="server" Text="Button" /> 



    PHP Code:
    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;

    namespace 
    RobustHaven.Components.KnowledgeBase.Web
    {
        public 
    partial class WebUserControl1 System.Web.UI.UserControl
        
    {
            protected 
    void Page_Load(object senderEventArgs e)
            {
                foreach (
    Control c in this.Controls)
                {
                    
    Response.Write(c.ClientID);
                }
    //            this.Button1.Text = "test";
            
    }
        }

    Response.Write doesn't print any controls out.

    and if i uncomment the line this.Button1.Text = "test";
    PHP Code:
    Error    6    'RobustHaven.Components.KnowledgeBase.Web.WebUserControl1' does not contain a definition for 'Button1' and no extension method 'Button1' accepting a first argument of type 'RobustHaven.Components.KnowledgeBase.Web.WebUserControl1' could be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\Administrator\My Documents\share\RobustHaven.Components.KnowledgeBase.Web\WebUserControl1.ascx.cs    24    18    RobustHaven.Components.KnowledgeBase.Web 
    anyone know what the problem is?

    by the way i know i can write it all out in terms of code but i would like to have the designer file....
    Attached Images Attached Images

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You need to look into VirtualPathProviders--that should let you do this.

    That said, unless one is very, very carefully configuration driven, I think having all the assets inside a DLL is a manageability folly. The other issue is that, at least for images, you are going to put a boatload of stress on the server as it is serving everything out of the ASPNET isapi rather than taking advantage of the very, very fast and easy static file serving bits of IIS.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •