VS2005 Beta 2 - Web User Control Issue

C

C Gatto

Hello,

In a VS2003 app I have an aspx page (default.aspx) with a PlaceHolder
defined (phMain). In my aspx code-behind I am dynamically creating a
reference to a web user control (CaseDetails.ascx), adding that control to
the placeholder, and then calling the web user control's various functions.
This works great in VS2003. But when the project was converted over to
VS2005 the Intellisense is now complaining that "Type 'CaseDetails' is not
defined" (all references to CaseDetails are underlined in blue). It will
still compile and run - telling me that the compiler has no problem with
this, but the VS2005 ide does seem to have a problem. Has anyone seen a
similar behavior ?

Code looks like:

****************************************
'CaseDetails Web User Control Class Definition
****************************************
Partial Public Class CaseDetails
Inherits System.Web.UI.UserControl

Private _intCaseNum As Integer

Public Property CaseNum() As Integer
Get
Return _intCaseNum
End Get
Set(ByVal value As Integer)
_intCaseNum = value
End Set
End Property

Public Function ftnTest() As Boolean
Return False
End Function
End Class

****************************************
'default.aspx - page_load event
****************************************
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Dim myCaseDetails As CaseDetails
myCaseDetails = CType(Page.LoadControl("CaseDetails.ascx"), CaseDetails)
phMain.Controls.Add(myCaseDetails)
myCaseDetails.ftnSomeFunction()
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top