After a year of answering questions at the WebParts and Personalization forum section, I consider the following items below as “frequently asked questions”.
I decided to write this so that I can point them to this post whenever I find a question that can be found here.
The following are the list of items that I consider as FAQ:
1. How to Get Started with ASP.NET WebParts?
ASP.NET Web Parts Overview
ASP.NET WebPart Controls
Implementing ASP.NET WebParts with Different Authentication modes
Video: Utilizing WebParts and Personalization
2. How to use WebParts inside UpdatePanel in ASP.NET 2.0?
Creating an AJAX Enabled Webparts in Aspnet 2.0
Note: the workaround mentioned in the link above will only be applicable on IE browsers.
3. WebParts Drag and Drop not Working on FireFox using ASP.NET 2.0
This is a very known issues on ASPNET WebParts.. Basically WebParts doesn't support the Drag and Drop feature in FF browser.. The drag and drop feature will only work if you are using Visual studio 2008 /VWD 2008 with latest version of the WebPart Futures (AJAX Control Toolkit 3.5)..
You may refer below for more information:
Ajax Enabled WebParts and Fire-Fox Drag-and-Drop
If you are working with ASPNET 2.0 then I have written a sample snippet at the following link below on how we are going to move the WebParts in fire-fox without the Drag and Drop Feature by using Custom Verbs.
Creating a Custom WebPartZones with Custom WebPartVerbs
You can also use Atlas to support the drag and drop feature in firefox in ASP.NET 2.0.
ASP.NET 2.0 Web Part Drag/Drop Browser Support in FireFox w/ Atlas
AJAX Enabling ASP.NET 2.0 Web Parts with "Atlas"
4. How to use WebParts without using Forms or Window Authentication?
WEBPART with Anonymous Users
5. How to Use UserControls as WebParts?
How to: Treat a User Control as a Web Parts Control
How to video: Building Web Parts with User Controls and AJAX
6. How to Access Controls from UserControls
ASPNET WebPart FAQ: Accessing Controls from UserControls in ASPX page
7. How to apply Themes /Skins in WebParts?
The following example below shows the basic way on how to apply skins to WebParts
ASP.NET WebParts with Skins
8. How to Add Dynamic WebParts in the WebPartZone?
Here are some useful articles below that you can refer:
Programmatically adding a Web Part in ASP.NET 2.0
Dynamically adding WebParts using WebPartManagerInternals class
9. How to add WebParts to Catalog Dynamically?
Here are some useful articles below that you can refer:
Dynamically Adding Custom User Controls to a Web Part Catalog Zone / User Controls / ASP. NET
Dynamically adding webparts to the dynamically added Catalog zone
ASP.NET WebParts and CatalogPart Sample
10. How to Communicate Between WebParts?
You can use the ConnectionZone to communicate between WebParts.. Check these links below for more information:
WebParts Communication: How WebParts on a page communicate with each other
WebPart Communication
11. How to Hide WebParts Based on Users?
You can set roles to users so that you can easily hide the WebParts using the AutorizationFilter attribute as demonstrated below:
Show/Hide WebParts based on Roles
12. How to Hide WebParts?
If you wan’t to hide it manually then we can use the Hidden property to Hide WebParts in the Zone. See below example:
protected void Button1_Click(object sender, EventArgs e)
{
WebPartZone1.WebParts["WebPartID"].Hidden = true;
}
You may also close the WebParts instead using the CloseWebPart method of WPM and add it back again via PageCatalogPart.
13. How to Add Custom Verbs to WebParts?
You can add your own verbs by extending the WebPartZone base class and override the OncreateVerb method for you to add your own verbs for all the WebParts. See the example in the link below for more info.
Creating Custom WebPartZones with Custom verbs (Move right/ Move Left)
If you wan’t to add a custom verb to a particular webpart then you can override the WebPartVerbCollection class as demonstrated in the link below:
Add Verbs to the WebPart's menu.
14. How to work WebParts with Master Page?
Basically, WebParts Personalization are stored on a page by page basis. Web Parts personalization settings for the pages that use the Master Page are stored separately from one another, preventing you from applying a single set of Web Parts to every page on the site.
Here's an interesting article below that demonstrates on how to: Sharing WebParts across Multiple Pages
15. How to Create WeParts with Multiple Pages?
Dynamic Tabbed Web Part Pages
16. How to Create WebPart like IGOOGLE?
If you really want to have a great overview of how to create such a web 2.0 ajax enabled portal I can highly recommend Omar Al Zabir's book Building a Web 2.0 Portal with ASP.NET 3.5. He's the founder of pageflakes.com and the open source portal called dropthings.
Dropthings Demo
Dropthings Source Code
17. How to create Custom WebParts?
The following link below shows on how to create a custom webparts by extending the WebParts class.
Web parts: the building blocks of portals
18. How to use WebParts using Own Database?
You need to create your own Personalization Providers for storing the webparts personalization data. Check these links below for more information:
WebPart Personalization Providers
Custom Provider Based Service
WEB PARTS ORACLE PERSONALIZATION
That's it! Hope you will find this post useful
Technorati Tags:
ASP.NET,
WebParts