Okay, I figured it out (with help to you guys, of course!). The namespace is "ASP" for this website. I don't know why, but it is. I'll give a little background. I started at this company in October, and I didn't start working on the web application until
February. The software is a subscriber based web application spread across multiple server farms. It was originally done in classic ASP, and only a few new parts are being coded in ASP.NET (my Crystal Reports module is one of them). Everyone has a copy of
the webapp in there local IIS folder, so I connect to the website under localhost IIS. It has a lot of .asp and other files, so it's not a deployed project. I save the pages I work on, then browse to http://localhost/apage.aspx to test.
There is no namespace in the code-behind files. From your post it sounds likes the ASP namespace is the default namespace for controls referenced. Anyways, this works for me. I'll post the relevant code. You won't be able to run it, there's some framework
objects there that are just to complicated to post.
using System; using System.Collections; using System.Configuration; using System.Data; 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; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Data; 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;
public partial class controls_reports_ScheduledReports : System.Web.UI.UserControl { public event CommandEventHandler EditSchedule; public event CommandEventHandler DeletedSchedule;
aazizorg
Member
3 Points
7 Posts
Re: Using the class of a user control in code-behind
May 22, 2009 03:08 PM|LINK
Okay, I figured it out (with help to you guys, of course!). The namespace is "ASP" for this website. I don't know why, but it is. I'll give a little background. I started at this company in October, and I didn't start working on the web application until February. The software is a subscriber based web application spread across multiple server farms. It was originally done in classic ASP, and only a few new parts are being coded in ASP.NET (my Crystal Reports module is one of them). Everyone has a copy of the webapp in there local IIS folder, so I connect to the website under localhost IIS. It has a lot of .asp and other files, so it's not a deployed project. I save the pages I work on, then browse to http://localhost/apage.aspx to test.
There is no namespace in the code-behind files. From your post it sounds likes the ASP namespace is the default namespace for controls referenced. Anyways, this works for me. I'll post the relevant code. You won't be able to run it, there's some framework objects there that are just to complicated to post.
Here's the page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReferencingControlsIncodeBehind.aspx.cs" Inherits="_test_ReferencingControlsIncodeBehind" %> <%@ Reference Control="~/_test/WebUserControlInline.ascx" %> <%@ Reference Control="~/_test/WebUserControlCodebehind.ascx" %> <%@ Reference Control="~/controls/reports/ScheduledReports.ascx" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:PlaceHolder ID="placeholder" runat="server"></asp:PlaceHolder> </div> </form> </body> </html>And the code behind:
And the ReportScheduler.ascx
And it's code behind: