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: 4/10/2006 10:06:49 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 20 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
vmalvarez
Asp.Net User
WebPart exportMode in UserControl. Inherit from 2 classes4/10/2006 10:06:49 AM

0/0

Hello.

I have a WebPartBase.cs class that inherit from UserControl and IWebPart.

namespace

grupo.WebParts{

         public class WebPartBase : UserControl, IWebPart {

         .........

This class is used in multiple UserControls, for instance:

         public

partial class webparts_news : grupo.WebParts.WebPartBase {

         ..........

I like to add ExportMode=All in my WebPartBase class, but IWebPart interface doesn?t have this property. I would like inheriting from 2 classes (UserControl and WebPart) to do it, but It's impossible in .NET 2.0.

Any posibilities?

mharder
Asp.Net User
Re: WebPart exportMode in UserControl. Inherit from 2 classes4/10/2006 10:33:51 PM

0/0

Two options:

1. Set the property on the GenericWebPart wrapping the UserControl:
GenericWebPart gwp = WebPartManager.GetCurrentWebPartManager(Page).GetGenericWebPart(this);
gwp.ExportMode = WebPartExportMode.All;

2. Set the "ExportMode" expando via the IAttributeAccessor interface.  The GenericWebPart will pull the value from the IAttributeAccessor and set its ExportMode property:
((IAttributeAccessor)this).SetAttribute("ExportMode", "All");

-Mike
http://blogs.msdn.com/mharder

This posting is provided "AS IS" with no warranties, and confers no rights.
DWS400
Asp.Net User
Re: WebPart exportMode in UserControl. Inherit from 2 classes4/11/2006 5:54:05 AM

0/0

3rd option,

You have to web.config see I have enableExport set to true.  At run time you can check the allow export in the behavior editor.  Is the next question the importCatalogpart?  Cause the importcatalogpart imports webparts that have been exported.

<

webParts enableExport="true">

<

personalization >

<

authorization>

<

allow users="DWS400" verbs="enterSharedScope, modifyState"/>

</

authorization>

</

personalization>

</

webParts>

 

 You have to use the behavior editor to enable export and web.config

vmalvarez
Asp.Net User
Re: WebPart exportMode in UserControl. Inherit from 2 classes4/11/2006 7:57:47 AM

0/0

Thanks Mike.

Your reply helped me. I update the code, this is the result:

UserControlBase class:

...............

WebPartCollection colecionWebParts = WebPartManager.GetCurrentWebPartManager(Page).WebParts;

foreach (WebPart wp in colecionWebParts){

         wp.ExportMode = WebPartExportMode.All;

}

..............

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


Free Download:


Web:
WebPart exportMode in UserControl. Inherit from 2 classes - ASP ... WebPart exportMode in UserControl. Inherit from 2 classes. Last post 04-11-2006 3:57 AM by vmalvarez. 3 replies. Sort Posts: ...
Web Parts Control Description Files WebParts.WebPart control (or other ASP.NET server or user control used in a ... ... NET server control that does not inherit from the WebPart class. ...
CatalogZoneBase Class (System.Web.UI.WebControls.WebParts) A user control that enables you to change display modes on the Web page. ..... Minimal)> _ Public Class TextDisplayWebPart Inherits WebPart Private ...
Tech Notes: Using User Control in Sharepoint Web Parts Make sure you specify this user control to inherit from the solution assembly. .... type="exportmode">All. . . ...
mob's dev blog - SharePoint & Web Parts & User Controls, Oh My! Jul 5, 2007 ... public class MyGroovyWebPart :. System.Web.UI.WebControls.WebParts.WebPart. {. public MyGroovyWebPart(). {. this.ExportMode ...
Building WebParts in ASP .Net 2.0 OOPS Concepts and .NET Part 2: Inheritance, Abstraction, & Polymorphism .... That command only appears in the verbs menu if the Web Part's ExportMode ...
Building Portals Using the Web Parts Framework Listing 7-36. Setting a Nonconfigurable ExportMode on a UserControl-Based Web Part. Partial Class DateTimeWebPart. Inherits WebPartUserControl ...
MSDN SharePoint - Development and Programming Error using ... public class Trialpart : System.Web.UI.WebControls.WebParts.WebPart. {. UserControl userControl;. public Trialpart(). {. this.ExportMode = WebPartExportMode ...
Pranab Paul's Blog - SharePoint 2007 (MOSS/WSS 3.0) Development ... If you inherit Microsoft.SharePoint.WebPartPages.WebPart instead of webcontrol it works .... Pranab, It is good when we have one o r two usercontrols but, ...
U2U Articles When someone enters text into the user control, the custom web control will display this text. So the data that will flow between the two web parts is a ...




Search This Site:










visual studio.net html formatting

bandwidth restrictions per portal (on a dedicated server) ?

mk.bat

asp:image and master pages..an easy one i think!

displaying html in a textbox

how to get ad user

using portal.css upon private assembly module

treeview not working when migrated to 2.0

? re: experience with dnn content builder

setting user control property programmatically

how to transfer customerid from orderlist.aspx to orderdetail.aspx

to modify the noun of the dotnetnuke.all project?

posting or replying on forums page

undo add module to all pages

dev environment really slow to load dnn

ack. the old "there is a problem with your selected data store. this can be caused by an invalid server name or credentials..." error message in trying to change my provider from sqlexpress to sql2k...

sever problem with references usnig asp.net vb projects

custom sitemapprovider that should get fresh data when parameters changes

convert to partial classes

web adminisration tool....

form authentication

aspnet_regiis.exe "cannot be opened" error

ngallery to dnn gallery converter

new httpresponse class, please help

asp.net web admin with custom provider

is it possible to run custom controls in <title><meta> tags without placing the form tag at the start of the page?

runtime error

dnn 2 win 2003 permissions

converting treeview

securing .doc / .pdf or .xml files under forms authentication

 
All Times Are GMT