CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 5/9/2005 9:04:43 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
Jleary
Asp.Net User
Best Practices - Generic Web Parts or Custom Built?5/9/2005 9:04:43 PM

0/0

I have been trying to figure out how to proceed with webpart development in my first ASP.NET 2.0 webpart app. I understand the process of generically wrapping a user control vs. creating a custom build webpart. The benefits of creating a custom built webpart are obvious, but for developing complex parts, the lack of WYSIWYG ability in the IDE is a bit of a pain. The user control approach is easy, but not as structured as I would like. I will be using lots of static connections so I would like to build those interfaces right in. The best case would seem to be a custom webpart that acts as a wrapper to a user control. Does this seem feasible? Basically, I want to have the abiltiy to create basic user controls and for each create a wrapper with webpart specific code.

MrBuzzcut
Asp.Net User
Re: Best Practices - Generic Web Parts or Custom Built?5/9/2005 11:43:58 PM

0/0

Maybe you could inherit from GenericWebPart and add in all the custom plumbing you need.

Then, in code, use (where MyGenericWebPart is your derived Class):

MyGenericWebpart MyWebPart = WebPartManager.CreateWebPart(LoadControl("SomeUserControl.ascx"));

 

WhatMeWorry
Asp.Net User
Re: Best Practices - Generic Web Parts or Custom Built?5/10/2005 8:31:38 PM

0/0

I think so, though I'm still in the midst of a work in progress.  I I've started using the approach of having a Custom WebPart that loads a corresponding User Control, or multiple UserControls but mainly to be able to use the many User Controls I already have while being able to use the full capabilities of WebParts.  (I ran into difficulties using User Controls wrapped in generic WebParts when I tried to add the ability to automatically generate Editor Parts for my WebPart from the property definitions using reflection.)

Although this creates some redundancy in setting properties, by default I use reflection to set the properties of the user control by corresponding Property Name and property return type.  E.g. from my Base Web Part class:

protected override void CreateChildControls() {

this.Controls.Clear();

LoadUC(UCpath);

}

protected virtual void LoadUC(string UCPath) {

Control ctrl = this.Parent.Page.LoadControl(UCPath);

ctrl.ID = System.Guid.NewGuid().ToString();

 

Type ctrlType = ctrl.GetType();

Type thisType = this.GetType();

 

//All properties of the loaded UserControl which have the same name

//and type are set to the same value of those properties in the webpart.

foreach (PropertyInfo propInfo in thisType.GetProperties()) {

object objectValue = propInfo.GetValue(this,null);

Type propType = propInfo.PropertyType;

PropertyAttributes propAttributes = propInfo.Attributes;

PropertyInfo ctrlPropInfo = ctrlType.GetProperty(propInfo.Name);

if ( ctrlPropInfo != null && ctrlPropInfo.PropertyType == propType && ctrlPropInfo.CanWrite) {

ctrlPropInfo.SetValue(ctrl, objectValue, null);

}

}

this.Controls.Add(ctrl);

}

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ESEC/FSE '05: Proceedings of the Joint 10th European Software Engineering Conference (ESEC) and the 13th ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE-13) : September 5-9, 2005, Lisbon, Portugal Authors: Harald Gall, ACM Sigsoft, ACM Sigsoft, Pages: 391, Published: 2005
Java Enterprise Best Practices Authors: Robert Eckstein, Pages: 277, Published: 2002
Manufacturing, Distribution, And Retail Guide Authors: William Wiersema, Pages: 0, Published: -1
Pro JSP 2 Authors: Simon Brown, Sam Dalton, Daniel Jepp, Kevin Mukhar, Dave Johnson, Sing Li, Matt Raible, Pages: 728, Published: 2005
ASP.NET Solutions: 24 Case Studies : Best Practices and Design Patterns for Developers Authors: Richard C Leinecker, Pages: 0, Published: 2003
Web Engineering: 4th International Conference, ICWE 2004, Munich, Germany, July 26-30, 2004 ; Proceedings Authors: Nora Koch, Piero Fraternali, Martin Wirsing, LINK (Online service), Pages: 623, Published: 2004
Expert One-on-one J2EE Development Without EJB Authors: Rod Johnson, Juergen Hoeller, Pages: 552, Published: 2004
J2EE Best Practices: Java Design Patterns, Automation, and Performance Authors: Darren Broemmer, Pages: 471, Published: 2002
Essential Color Management Authors: Gry Garness, Pages: 0, Published: -1

Web:
Best Practices - Generic Web Parts or Custom Built? - ASP.NET Forums Re: Best Practices - Generic Web Parts or Custom Built? 05-09-2005, 7:43 PM ... Re: Best Practices - Generic Web Parts or Custom Built? 05-10-2005, 4:31 PM ...
Best Practices for Developing Web Parts for SharePoint Products ... Learn best practices to improve performance and usability of Web Parts, .... For more information, see Creating a Web Part with Custom Properties in the ...
MSDN SharePoint - Development and Programming Webpart wrapper ... RE: Webpart wrapper? custom user controls.. web.config? Best Practices? New to sharepoint. Looking to clarrify a few things. We are going to want to build ...
Best Practices for Developing Web Parts for SharePoint Products ... simple way to localize certain attributes (FriendlyName, Category, and Description) of your custom. Pagina 8 di 10. Best Practices for Developing Web Parts ...
Sharepoint Tips And Tricks: Thoughts and best practices around the ... Mar 5, 2008 ... It specializes in Microsoft SharePoint technologies, including web parts, development, configuration, customization, and best practices for ...
SharePoint Web Parts | SharePoint BUZZ - Your SharePoint Community ... SmartPart 0.2.0.1 Distributable -The SmartPart is a generic Web Part that can ... Demonstrates how to build Web Parts that have custom properties and custom ...
Tech Notes: Custom Search Web Part May 10, 2008 ... Custom Search Web Part. If you don't like look and feel of the ... NET web parts . using System;. using System.Collections.Generic; ...
SharePoint Happenings - SharePoint Blog, tips and tricks, and web ... Jun 9, 2008 ... Phil’s Top 10 Best Practices for Branding SharePoint (Part 2 of 10) ... with stating my second of ten best practices: Build custom Site ...
Web Part Caching – A simple approach - Tobias Zimmergren's ... Oct 7, 2008 ... at Web Parts, creation of custom webparts and best practices for ... the built-in caching functionality of WSS 3.0 Web Parts if you feel ...
Work Web Part Magic Inside of ASP.NET Jun 16, 2006 ... NET 2.0 Web parts just as you would have built a SharePoint Web part—by .... Internet.com eBook: Best Practices for Developing a Web Site ...

Videos:
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared to Ruby-on...




Search This Site:










about data!

about frame...

installer for web site & win service

gearing up to host next gen .net web applications?

retrieve from database and populate text boxes

text if not null

cast from string "" to type 'date' is not valid

session variables

looping in asp.net

ngallery module

complex sql query

font settings

authentication and windows firewall in asp.net 2.0

deploy asp.net 2.0 memebership database

multiples skins

log out page

a problem about ip access control in iis

microsoft web controls

using buttons for hyperlinks

web deployment project with copy web site

creating webpage

server error in '/' application.

nested web parts

load images via javascript in global.asax

deployment: chile-up.com

response.statuscode does not display the error page - roles

cache.count = 0 after adding item

converting money to varchar

handling null in table adapter

tree view component

 
All Times Are GMT