Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ascx vs dll error

Status
Not open for further replies.

slatetm

Programmer
Mar 20, 2007
16
0
0
US
This might be too general of a question but I'm hoping someone will know. I created a user control. When I have the user control in my project as a .ascx page everything works fine. When I have the control in my project as a DLL it does not work. The first time it tries to reference one of the controls on the page, in this case a list box, I get a "object not set.." error. I realize that it is due to it not being initialized before this line but what exactly is the difference between the page loading as a ascx and as a dll?

 
an ascx is a web user control. it has a visual designer so it's easier to define layout. when a web user control is used within a project, both the ascx and tha ascx.cs files are required.

custom controls are written entirely in code (cs, js, css, xml ...) there is no visual element like an ascx. when compiled all you have is the assembly (dll). to add this control to a project simply reference the assembly.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top