Sure it can. Not sure about the drag-and-drop, but click the Html
button and get into the code-side of the presentation page. Make sure
to put an @Register page directive at the top to register your user
control (for more info, google "ASP.Net User Controls"--MSDN has a page
explaining how to properly insert the tag.)
Personally, I like to expose only the properties of the user control's
sub-controls (in your case, the drop-down control) that I'm going to
use, via a property in the code-behind. It just makes things cleaner.
For a quick-and-dirty approach, however, change the access modifier for
the drop-down control in the user-control's code-behind (.ascx.cs or
..ascx.vb file, depending on which language you're using) from
"protected" (if C#; or "Friend" if VB) to "public". If you dragged your
drop-down list onto your .ascx page, you should see your drop-down
control defined near the top of the page. It'll probably be something
like DropDownList1. Once you've change the access modifier to public,
you should be able to see the control in your aspx page's code-behind
file (e.g. myUserControl.DropDownList1.) You'll be able to access all
of the properties of the drop-down control as if you were working with
it in the .ascx page.
|