So I need to create a webpart. I'd like some control over the design process, and creating the code for the controls then build/compile wait for app-recycle and then F5 the sharepoint, rinse and repeat site is a pain.
I was reading that it's possible to just create a regular user control, and have that load in the webpart. Ideal I think - but!
What about all of the sharepoint stuff? Like the properties, and interacting with sharepoint lists and so on? How would I accomplish this best from the user control?
What I need exactly, is a webpart displaying firstly a set of information of one item in a sharepoint list, and secondly it needs to show a scrollable list of items from another sharepoint list.
Is there a fancy way of getting pretty much the identical 'environment' or should I just go like:
using(SPSite site = new SPSite("http://mysite/")){
using(SPWeb web = new SPWeb("myWeb")){
//Fill a listbox with web.lists["myList"];
}
}
From the code-behind of my usercontrol?