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: 8/10/2004 1:32:09 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 16 Views: 93 Favorited: 0 Favorite
17 Items, 1 Pages 1 |< << Go >> >|
raguin
Asp.Net User
OnClick Design mode8/10/2004 1:32:09 PM

0

Hello,
Im trying to get the functionality simmilar to my.msn, where you can click the head of each web part and drag it. I cant seem to find a way to tell if the head of a web part is clicked on in normal display mode. Any ideas?

Thanks
Fredrik N
Asp.Net User
Re: OnClick Design mode8/10/2004 2:55:38 PM

0

Set the WebPartManager's DisplayMode property to DesignDisplayMode.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
raguin
Asp.Net User
Re: OnClick Design mode8/11/2004 3:43:32 PM

0

Right, but how do you know when they click on the webpart title in browse mode. I want to click and drag.
Fredrik N
Asp.Net User
Re: OnClick Design mode8/11/2004 4:01:15 PM

0

When the mode is set to DesignDisplayMode, you can drag around webparts. If you want to get the the WebPart that are moved, you can use the WebPartManager's WebPartMoved event. This event will be executed when the WebParts has bean moved to a new zone.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
mharder
Asp.Net User
Re: OnClick Design mode8/16/2004 6:55:36 PM

0

There is no way to drag and drop WebParts in BrowseDisplayMode.
http://blogs.msdn.com/mharder

This posting is provided "AS IS" with no warranties, and confers no rights.
lportx
Asp.Net User
Re: OnClick Design mode8/24/2004 2:24:32 PM

0

It would be nice if users could drag around the web part without having to switch a menu or toggle a state. At least, they should not be *aware* they are toggling a state.

Any limitations in having the default state be design and not browse? All of the webparts will display and function as they normally do in design state, right?

I guess, if this is not the case, the workaround is to have a clickable region or button in the header which toggles the state to design, and then reverts back to browse state onmouseup?

LP
.:: lawrenceport.com ::.
Fredrik N
Asp.Net User
Re: OnClick Design mode8/24/2004 3:26:08 PM

0

The WebPart will still be working even if you change the mode to the desing mode.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
mharder
Asp.Net User
Re: OnClick Design mode8/24/2004 9:12:04 PM

0

I think the best workaround would be to always have the WebPartManager in DesignMode instead of BrowseMode. For example, you could write a derived WebPartManager and override the DesignMode property getter, so that it returns DesignDisplayMode instead of BrowseDisplayMode.
http://blogs.msdn.com/mharder

This posting is provided "AS IS" with no warranties, and confers no rights.
optionDK
Asp.Net User
Re: OnClick Design mode8/25/2004 8:50:25 AM

0

Hi everybody

How do you recognize the current displaystate from within a webpart (Browsemode / editmode / catalogmode and so) - I have tried me.webpartmanager.displaymode.name but it says Browse no matter what happens in real.
Best regards


Henrik S?rensen, OPTION APS Denmark
Fredrik N
Asp.Net User
Re: OnClick Design mode8/25/2004 10:29:23 AM

0

Where did you try to get the Name (which event)? If you use the WebPartPageMenu, the mode is set after the Page_Load event. So if your try to get the Name of the current view in the Page_Load, you will get the previous mode. If you change the mode programmatically before your get the Name of the DisplayMode, you should get the correct name. You can also get the current name of the mode, within the Page_PreRender event.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
optionDK
Asp.Net User
Re: OnClick Design mode8/25/2004 11:33:06 AM

0

Hi Fredrik

I tried in the CreateChildControls event and in page_load but got the same 'browse' as result every time.

I looked after an overridable event that would raise when the control changes its state - like the syncChanges / applyChanges events in the editorpart
Best regards


Henrik S?rensen, OPTION APS Denmark
Fredrik N
Asp.Net User
Re: OnClick Design mode8/25/2004 12:05:16 PM

0

You can hook up to the WebPartManager's DisplayModeChanging and DisplayModeChanged.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
lportx
Asp.Net User
Re: OnClick Design mode9/9/2004 8:39:42 PM

0

I am keeping the manager in design mode - however, now I am seeing the zone titles displayed and I don't want this to be the case.

This is not happening for my instance of WebPartZone, but it is occurring with a subclass I have created. I created the subclass to encapsulate a WebPartZone with styles I need to use over and over again.

Is there a property I need to set?

Here's my code. I commented out the hacks I tried to get this working. I also tried overriding RenderHeader and not implementing anything but alas, to no avail.

public class USWebPartZone : WebPartZone
{

public USWebPartZone()
{
this.BackColor = System.Drawing.Color.White;
this.MinimizeVerb.ImageUrl = "images/icon_minimize.gif";
this.RestoreVerb.ImageUrl = "images/icon_maximize.gif";
this.CloseVerb.ImageUrl = "images/icon_close.gif";
this.BorderStyle = BorderStyle.None;
//this.HeaderStyle.Height = new Unit(0);
//this.HeaderStyle.BackColor = System.Drawing.Color.Blue;

// Eliminate black box around web parts
this.PartChromeStyle.BorderStyle = BorderStyle.None;
this.PartTitleStyle.Height = new Unit(0);

// Format title bar
this.PartTitleStyle.CssClass = "boxheader";
this.PartTitleStyle.Font.Bold = true;
this.PartTitleStyle.ForeColor = System.Drawing.Color.FromArgb(0xffffff);
this.PartTitleStyle.Font.Names = new string[] { "Arial", "Verdana" };
this.PartTitleStyle.Font.Size = new FontUnit("8pt");

// Format content area of web part
this.PartStyle.CssClass = "box";
this.PartStyle.BorderWidth = new Unit(1);
this.PartStyle.BorderStyle = BorderStyle.Solid;
this.PartStyle.CellPadding = 5;
this.PartStyle.BorderColor = System.Drawing.Color.FromArgb(0xCCCCCC);
}

protected override void Render(HtmlTextWriter writer)
{
//this.HeaderText = "Yadda";
base.Render(writer);
}

}




.:: lawrenceport.com ::.
mharder
Asp.Net User
Re: OnClick Design mode9/9/2004 9:11:05 PM

0

There are 2 solutions that may work for you:

1. Override RenderHeader() and don't render anything. If you still can't get this to work for you, please post a repro so I can investigate.

2. Override the DisplayTitle property to return String.Empty.

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

This posting is provided "AS IS" with no warranties, and confers no rights.
lportx
Asp.Net User
Re: OnClick Design mode9/10/2004 7:44:10 PM

0

Mike:

I tried both overriding RenderHeader() with no body to the method and returning string.Empty from the overloaded DisplayTitle property.

I don't get a title but there is extra space at the top, so it does not align with the next <td> cell, which contains the original WebPartZone.

For your investigations:

1) Add these two methods to my previous post to get the complete class definition for my USWebPartZone:

protected override void RenderHeader(HtmlTextWriter writer) {}
public override string DisplayTitle { get { return string.Empty; } }

2) Here is how I am using my zone in my aspx file:

<td style="width: 35%; height: 21px" valign="top">
<!-- This cell contain the left hand side WebZone -->
<cc1:USWebPartZone ID="USWebPartZone2" Runat="server">
<ZoneTemplate>
....

the next cell has a traditional webpartzone:

<td style="width: 65%; height: 21px" valign="top">
<WebPartZone ID="MessageZone" Runat="server" Width="100%">
<ZoneTemplate>
....

3) HTML Output with manager in DEFAULT mode, down to the row which is the title bar for the first web part:

<!-- This cell contain the left hand side WebZone -->
<table cellspacing="0" cellpadding="0" border="0" id="ctl00_Content_USWebPartZone2" style="background-color:White;">
<tr>
<td style="height:100%;"><table cellspacing="0" cellpadding="2" border="0" style="width:100%;height:100%;">
<tr>
<td><table class="aspnet_s0" cellspacing="0" cellpadding="1" border="0" id="WebPart_InboxWebPart" style="width:100%;">
<tr>
<td class="boxheader aspnet_s3"><table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td nowrap="nowrap" id="WebPartTitle_InboxWebPart" style="width:100%;"><span class="aspnet_s2">Inbox</span>&nbsp;</td>
</tr>
</table></td>
</tr>


4) DESIGN mode output, and goes down to the same point in the code.

<!-- This cell contain the left hand side WebZone -->
<table cellspacing="0" cellpadding="0" border="0" id="ctl00_Content_USWebPartZone2" style="background-color:White;">
<tr>
<td style="white-space:nowrap;"><table cellspacing="0" cellpadding="2" border="0" style="width:100%;">
<tr>
<td nowrap="nowrap"></td>
</tr>
</table></td>
</tr><tr>
<td style="height:100%;"><table cellspacing="0" cellpadding="2" border="0" style="width:100%;height:100%;border-color:Gray;border-width:1px;border-style:None;">
<tr>
<td style="padding-top:1;padding-bottom:1;"><table cellspacing="0" cellpadding="0" border="0" style="width:100%;border-left:solid 3px Blue;border-right:solid 3px Blue;visibility:hidden;">
<tr>
<td style="font-size:0px;"><div style="margin:2px 0px 2px 0px;height:2px;width:100%;background-color:Blue;">

</div></td>
</tr>
</table></td>
</tr><tr>
<td><table class="aspnet_s0" cellspacing="0" cellpadding="1" border="0" id="WebPart_InboxWebPart" style="width:100%;">
<tr>
<td class="boxheader aspnet_s3"><table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td nowrap="nowrap" id="WebPartTitle_InboxWebPart" style="width:100%;"><span class="aspnet_s2">Inbox</span>&nbsp;</td>
</tr>
</table></td>
</tr>
Larry
.:: lawrenceport.com ::.
Fredrik N
Asp.Net User
Re: OnClick Design mode9/10/2004 9:52:17 PM

0

If you are talking about the "box" with a gray border around the Webpart, you can remove it by overriding the RenderBody method of the WebPartZone class. But if you leave this empty, not WebParts will be displayed. You have to render the webpart:

For example:

protected override void RenderBody(HtmlTextWriter writer)
{
....

foreach (WebPart webpart in this.WebParts)
{
this.CreateWebPartChrome().RenderWebPart(writer, webpart);
}

....
}


If you want to change the way the Webpart are rendered (if it should have border, and how the order should look like etc), you can create your own WebPartChrome class by inherits the WebPartChrome class and override the CreateWebPartChrome method and make it return you chrome.

/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
esbenr
Asp.Net User
Re: OnClick Design mode6/4/2006 12:33:44 AM

0

Hi

In the properties for the webzone set the headertext to at blank space (yes its a bad solution but i does the job). Now the title of the webzon has gone.

Then set the borderstyle to "NotSet" or "None"

Thats it. the extra space caused by the designview has been reduced - at least.

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


Free Download:

Books:
Developing Microsoft Office Solutions: Answers for Office 2003, Office XP, Office 2000, and Office 97 Authors: Ken Bluttman, Pages: 586, Published: 2003
The Web Programmer's Desk Reference: A Complete Cross-reference to HTML, CSS, and JavaScript Authors: Lazaro Issi Cohen, Lázaro Issi Camy, Joseph Issi Cohen, Pages: 1085, Published: 2004
Essential ASP .NET 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2007
Foundations of Digital Signal Processing: Theory, Algorithms and Hardware Design Authors: Patrick Gaydecki, Institution of Electrical Engineers, Pages: 462, Published: 2004
Practical .NET2 and C#2: Harness the Platform, the Language, the Framework Authors: Patrick Smacchia, Pages: 896, Published: 2006
Beginning Visual Basic 2005 Authors: Thearon Willis, Bryan Newsome, Pages: 799, Published: 2005
Beginning Excel Services Authors: Liviu Asnash, Eran Megiddo, Craig Thomas, Pages: 404, Published: 2007
Beginning VB.NET: Unmasking Visio for Enterprise Architects Authors: Richard Blair, Matthew Reynolds, Jonathan Crossland, Thearon Willis, Pages: 888, Published: 2002
Beginning C# 2008 Databases: From Novice to Professional Authors: Vidya Vrat Agarwal, James Huddleston, Ranga Raghuram, Syed Fahad Gilani, Jacob Hammer Pedersen, Jon Reid, Pages: 482, Published: 2008
Practical JavaScript, DOM Scripting, and Ajax Projects Authors: Frank Zammetti, Pages: 546, Published: 2007

Web:
OnClick Design mode - ASP.NET Forums OnClick Design mode. Last post 06-03-2006 8:33 PM by esbenr. 16 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
designMode = "on" and onclick event on HTML elemen • mozillaZine ... mozilla developer center wrote: A further difference for Mozilla is that once a document is switched to designMode, all events on that particular document ...
onclick event in iFrame with designMode="on" - WebDeveloper.com onclick event in iFrame with designMode="on" JavaScript.
Attachment – dojo – Trac 510, var handle = dojo.connect(this, "onClick", this, function(){. 511, this. document.designMode = 'on';. 512, dojo.disconnect(handle); ...
Document design Mode : document « Javascript Objects « JavaScript ... Document design Mode : document « Javascript Objects « JavaScript DHTML. ... < button onclick="alert(document.designMode);">Design Mode Status ...
designMode="on" for iframe - event handler on radio/checkbox input ... Mar 28, 2008 ... I have an iframe inside a page, this iframe has the designMode property ... I tried to set a onfocus, onclick, onselect in the input tag ...
JAVASCRIPTS :: Iframe Inside Another Iframe (with DesignMode="on") I have an iframe A with designMode = "on". I inserted another iframe B ..... onClick event handler to submit the form, because we use a mouseover effect. ...
Search Results – Xinha – Trac designMode == 'on') return false;}catch(e){} window.open(", "onclick=\"window. open("); html = html.replace("onclick=\"try{if(document.designMode && ...
Nabble - Mozilla - Editor - designMode="on" for iframe - event ... designMode="on" for iframe - event handler on radio/checkbox input type not ... I tried to set a onfocus, onclick, onselect in the input tag itself but ...
WebPartManager.DisplayMode Property (System.Web.UI.WebControls ... If you switch to design mode, you can drag the server controls from one zone to ... ID="Button1" runat="server" Text="Browse Mode" OnClick="Button1_Click" ...

Videos:
Web Applications and the Ubiquitous Web Google TechTalks February 1, 2006 Dave Raggett Dave Raggett is currently a W3C Fellow from Canon, and W3C Activity Lead for Multimodal ...






button that sends an email

web part crashes ie

the web part menu bar and adding items to it

how do i restrict a webpart to a particular webpartzone only

adding web part externally

creating dynamic, tabbed web part pages

how to rename a webpart

how to get a effect as igoogle at time of moving a webpart from on zone to other

imagebutton behaviour in webparts

hide webpartzones

datalist items as webparts?

getting started with developing portals?

strange personalization question

newbie - web parts designer

any provider

shared web part?

probleme deleting webpart

registerclientscriptresource and oninit in a webpart

wepart with gridview - how do i insert an image into a gridview column!?

any way to expire web parts after a certain time period?

webparts in gac (asp .net 2.0 not sharepoint)

anonymous webpart access

help needed with sqltableprofileprovider

httpexception (0x80004005) error

problem with createchildcontrols in an asp.net 2.0 web part

declarativecatalogpart visibility in catalogzone

can't able to do the user scope personlaiszation in webparts

beginnerproblems: webparts menu won't show.

problem in using web parts.

is sql server express ok for personalization on a production server?

   
  Privacy | Contact Us
All Times Are GMT