Several issues with building a user control

S

Shannon Cayze

Hello all,

I'm trying to build a user control (specifically, a date picker) and
am experiencing several issues. Also, I'm brand new to web development
and ASP.Net, so hopefully this will be fairly basic.

First, when I place the control on a WebForm, the designer lets me
place it exactly where I want it. However, when I run the app, the
control is displayed in the top left corner of the parent container
regardless of where it was in the designer.

Second, when the control is loaded, I run a method to fill the month,
day, and year DropDownLists with their values. However, they are empty
when they are displayed. I know the code is executed, because I can
throw an exception in the method. The AutoPostBack is set to true but
I don't think this is ever triggered. One way I can think of is to
force a PostBack but it doesn't seem that I'd need to.

Thirdly, if I have the control in a separate .dll that is referenced
by the web app, and include the namespace that it is under, I get the
following exception when attempting to run the app, even though I've
only got it defined in one .dll that is referenced: "CS1595:
'CustomWebControls.DateTimePicker' is defined in multiple places;
using definition from...". This is a problem because I want to be able
to access the object in C# code.

Lastly, how do you add a user control to the toolbox? When I select
customize toolbox, and find the .dll that the control is in, I'm told
that there are no items in the .dll that can be added to the toolbox.

Thanks in advance,
Shannon
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top