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:
<%@ 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 sender, EventArgs 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....
Bookmarks