Angel wrote:
> Unfortunately the WebUserControl is not exposed so that you can declare it..
> So there must be some other way. Anyone...
>
> Thanks though
>
I'm not sure I understand exactly what you mean by it's "not exposed".
Is this a 2005 web project by any chance (does it have an app_code
folder)? If so you can either upgrade to the 2005 web application
project
http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx
or work around the problem of not being able to pick up your codebehind
types at compile time by creating separate "stub" classes, placing them
in your app_code folder, and having your codebehind classes derive from
them. Like this:
Stub File:
Public Class _myWebUserControl
Inherits System.Web.UI.UserControl
Public Event SetFilter(ByVal FilterArgs As
KHE.Orion.Business.Components.FinancialAid.FAR.Rep orts.FilterArgs)
CodeBehind file:
Public Class myWebUserControl
Inherits _myWebUserControl
Sub Whatever()
RaiseEvent SetFilter(myArgs)
End Sub
On the Web Page:
Partial Class MyPage
Inherits System.Web.UI.Page
Sub LoadControl()
Dim ctl as _myWebUserControl =
CType(LoadControl("myWebUserControl.ascx"),_myWebU serControl)
Page.controls.add(ctl)
AddHandler ctl.SetFilter, AddressOf mySetFilter