CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 9/14/2006 7:52:45 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 55 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
ikeroppi1
Asp.Net User
HELP! Customizing EditorZone by retrieving WebPartToEdit9/14/2006 7:52:45 PM

0

I've been having trouble ALL day with this issue and am finding little help online at MSDN.  I'm fairly new to .NET and OO so it could just be an OO problem. 

 I'm trying to use the System.Web.UI.WebControls.WebParts.EditorZone.WebPartToEdit property.  It should be type WebPart, but I'm getting a null value returned.  I've created a custom class (see below) and call it from my code behind of my main page.  When I hardcode the ID of the control I'm referring to (in my calling page) it works just fine.  However if I call this class to dynamically grab the control currently in edit mode I get an error because the control is returned as null.

My WebPartBeingEdited Class:

1    Imports System
2    Imports System.Web
3    Imports System.Web.UI
4    Imports System.Web.UI.WebControls
5    Imports System.Web.UI.WebControls.WebParts
6    
7    
8    Public Class WebPartBeingEdited
9        Inherits System.Web.UI.WebControls.WebParts.EditorZone
10   
11       Dim _x As WebPart = Me.WebPartToEdit     'Find out which webpart is being edited.
12   
13       Public ReadOnly Property x()
14           Get
15               Return _x
16           End Get
17       End Property
18   
19   End Class

 

 My instantiation of my class from the code-behind of my main page:  

1    Dim part As GenericWebPart
2    Dim WebPartBeingEdited1 As New WebPartBeingEdited()
3    
4    part = WebPartManager1.GetGenericWebPart(BulletedList1)      'This line works, but is hard-coded =(
5    
6    'The following line is what I want but does not work.  WebPartBeingEdited1.x returns NULL
7    'part = WebPartManager1.GetGenericWebPart(WebPartBeingEdited1.x) 

   I appreciate any insight you can offer. 

Thanks!

Lauren


How did I get here? And what am I doing?
ikeroppi1
Asp.Net User
Re: HELP! Customizing EditorZone by retrieving WebPartToEdit9/15/2006 1:22:45 PM

0

Ok.  So I fixed it.  I didn't need a custom class at all.  In fact, the fix was much simpler than I was making it.  These two little lines of code in my code-behind grabbed the webpart I needed to work with no problem:

1    Dim part As WebPart
2    part = WebPartManager1.SelectedWebPart

 

So.. In case anyone is trying to figure out which webpart is in Edit mode, this is the way.  This was one of those "duh" moments.  But if it helps anyone else out then I guess its not all in vain.


How did I get here? And what am I doing?
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
HELP! Customizing EditorZone by retrieving WebPartToEdit - ASP.NET ... HELP! Customizing EditorZone by retrieving WebPartToEdit. Last post 09-15-2006 9 :22 AM by ikeroppi1. 1 replies. Sort Posts: ...
Writing Custom Editors for WebParts - ASP.NET, SharePoint ... The framework then will add those editors into the EditorZone. ... SyncChanges: This method is responsible for retrieving the current state of the ... edited by using the WebPartToEdit property available on the EditorPart itself. ... (For more help, see www.telerik.com.) Of course, you are not limited to using only ...
CodeGuru: Writing Custom Editors for WebParts Aug 23, 2006 ... The framework then will add those editors into the EditorZone. ... SyncChanges: This method is responsible for retrieving the current state of ... by using the WebPartToEdit property available on the EditorPart itself. ...
Writing Custom Editors for WebParts NET custom editor for your various WebParts, which is directly usable in ... The framework then will add those editors into the EditorZone. ... SyncChanges: This method is responsible for retrieving the current state of the WebPart ... edited by using the WebPartToEdit property available on the EditorPart itself. ...
Completely Dynamic Webparts with drag-drop & ATLAS functionality ... _loadedWebparts = new Dictionary(); // retrieve the web parts from the database: List lMWP ..... The following snippet can help you implement it. ... 2) Create custom EditorZone to edit the Webpart using System; using System. ... WebPartToEdit; System.Text.StringBuilder strBuilder = ...

HELP! Customizing EditorZone by retrieving WebPartToEdit - ng.asp ... HELP! Customizing EditorZone by retrieving WebPartToEdit, > ROOT > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization ...
Error- EditorPart does not have an ID - ng.asp-net-forum ... HELP! Customizing EditorZone by retrieving WebPartToEdit - ng.asp . ... AJAX enabled page inside a SharePoint Page Viewer Web Part - ng . ...
IGoogle like application using sharepoint & webparts? - ng.asp-net ... HELP! Customizing EditorZone by retrieving WebPartToEdit - ng.asp ... WebPartToEdit 'Find out which webpart is being edited. .... igoogle ...
User Profile caching of simple enums - ng.asp-net-forum ... HELP! Customizing EditorZone by retrieving WebPartToEdit - ng.asp ... user profile caching of simple enums · web parts survey ...
Dynamically Add WebPartZone - ng.asp-net-forum ... help! customizing editorzone by retrieving webparttoedit · working w/web parts programmatically across post backs · assigning edit & view roles to webparts ...












communication between usercontrol and webpart

adding webparts dynamically

profile object null and no properties.

how to send messages through a web app

what are exatly the properties of verbs??

how to host a windows user control in web part?

nested web parts

http://***.**.com/userhomepage.aspx? username=***

idea for two-verb button workaround

personalization

set profiles programatically

is there a way to show an external .htm page in a web part?

web parts - firefox compatibility issue

the specified display mode is currently disabled on this page. make sure personalization is enabled for the current user

how to disable webpart menu

how to build a tree type guest book?

interactive web part

webparts- verbs

profile settings safe for e-commerce?

how to hide an webpart title bar

copying a webpart instead of drag&drop?

webparts not showing close link

how can i hide webpart title in browse mode?

dynamic adding agragate webparts controls to declarativecatalogpart

declarativecatalogpart help!!

web part connections

missing verbs on titlebar for webparts

webpartmanager is undefined

web part info for internet - saved how?

dynamic control in webpart problem - urgent

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT