Why all the System.Web.UI.WebContorls?

G

Guest

I have an asp.net project containing several dozen webforms. For some reason
on one of these webforms in the Public Class area there is listed each
webform control as follows...

Public Class Logs_Detail
Inherits System.Web.UI.Page
Public strTitle As String
Dim IsItCustProp As String
Public IsItHistorical As String
-> Protected WithEvents btnBack As System.Web.UI.WebControls.Button
-> Protected WithEvents btnBundleValue As System.Web.UI.WebControls.Button
-> Protected WithEvents btnDesignate As System.Web.UI.WebControls.Button
-> Protected WithEvents btnUpdateStatus As System.Web.UI.WebControls.Button
-> Protected WithEvents ddlStatus As System.Web.UI.WebControls.DropDownList
-> Protected WithEvents Label17 As System.Web.UI.WebControls.Label
-> Protected WithEvents btnLocation As System.Web.UI.WebControls.Button

Why does this one form have all of these controls defined as such? Thanks.
 
M

Mike Newton

The form editor creates those declarations when you edit a form from it.

Every ASP.NET page built in VS.NET has this. The "WithEvents" just
means that the object exposes events that you can hook a handler to.

If those items aren't on your form, it might be caused by creating
events for those items, or working with them somewhere, then deleting
them with the designer.

That looks pretty normal to me.
 
G

Guest

Ok Thanks Mike. I've looked at the other forms and I see that these same
declarations exist within the other forms, only within a #Region which I had
not noticed previously. Thanks for your help.
 
C

clintonG

I don't know if it is pertinent to say so but I just discovered the VB IDE
writes the namespace "Inherits" declarations to the .proj file instead of
into the source code where common sense suggests such declarations should be
located.

--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET (e-mail address removed)
URL http://www.metromilwaukee.com/clintongallagher/
 

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

Top