Hi,
I like putting stuff in separate usercontrols, since i do a lot of gridview templatefields and putting several of these gridviews in one page messes up my .aspx. with user controls, i can just worry about the layout and design on my .aspx pages.
i have one problem though with my new personal approach,
example is i created a "Picture Gallery" site:
1. I put a FileUpload Control (which does NOT work in an UpdatePanel), a button that contains upload tasks (save file, add records to sql db), and an SQLDataSource control, in an AjaxControlToolkit ModalPopup. I then put them all in a UserControl, ill call it Upload.ascx.
2. I create another UserControl, which i shall call Gallery.ascx. This contains a DataList control, that displays the pictures and relative info from the sql db. DataList is connected to an SQLDataSource control. I put them in an UpdatePanel, so i can add an UpdateProgress control.
3. I then put Upload.ascx and Gallery.ascx in my Default.aspx
Ok it works fine, File uploads, records get inserted to the sql database, ModalPopup works! I have one major problem though, everytime I press the Upload Button from Upload.ascx, I need to call DataList.DataBind() from Gallery.ascx's Page_Load event, or simply UpdatePanel.Update(), since it will cause Page_Load to fire from Gallery.ascx UserControl. How do I do this?