I have a number of custom web parts which have similar functions and properties shared through each of them. Each have a subset of a larger set of functions, rather than redevelop the same controls over and over, is there a way I can build the user controls and then just drag and drop it on to my Visual Web Part as I would any other web project?
What I have is structured as follows:
- A number of web parts
- A Mapped folder for ControlTemplates with a sub folder for MyCustomControls
- User controls in the MyCustomControls folder.
When I drag and drop the user control into my Visual Web Part User control, all it does is add the path to the web part user control as a string. i.e. D:\Source\MyProject\ControlTemplates\MyCustomControls\CustomControl.ascx
There is nothing difficult in the web part yet, its purely HTML markup (at the moment):
<a href="#" id="dialog_link" class="floatright">
Content Title
</a>
<!-- ui-dialog -->
<div id="dialog" title="Content Title">
<p>Brief content</p>
<a href="#">Read More</a>
</div>