views:

1163

answers:

5

I have been using web parts on my site since ASP.NET 2.0 came out. Dragging and dropping web parts works great in Internet Explorer, but it doesn't work at all in Firefox, Chrome, or Safari. I recently upgraded the site to ASP.NET 3.5 SP1, but I am still unable to drag and drop web parts in non-IE browsers.

How can I enable drag and drop web parts in these other browsers?

Update (2/9/2010):

This mentions this problem, but offers no solution: http://forums.asp.net/t/1294857.aspx

Update (2/19/2010):

These posts offer a possible solution, but I have been unable to get it working yet on my site:

In short, these say the drag and drop problem was solved in "ASP.NET Futures (July 2007 release)" but for some crazy reason, was left out of ASP.NET 3.5 SP1. So to solve, you have to download the Futures release at: http://www.microsoft.com/downloads/details.aspx?FamilyId=A5189BCB-EF81-4C12-9733-E294D13A58E6&displaylang=en

Then, you need to use the WebPartManager and WebPartZone from the Microsoft.Web.Preview.UI.Controls.WebParts namespace.

+2  A: 

You must be using a very old version of "Atlas", because they fixed this quite a while ago (after beta 1).

Josh Stodola
We are using the most recent versions of ASP.NET and ASP.NET AJAX (3.5 SP1).
Kevin Albrecht
Then the problem lies in your project-specific stylesheet or javascript files, because the drag and drop works fine on Firefox. And that's going to be very difficult to pinpoint. You should try to create a barebones project with a couple very simple web parts and see if dragging works on Firefox. Works on my machine!
Josh Stodola
Well, I awarded you the bounty because your answer seems like the most likely solution. No one's solution on this page has worked yet, but at least you tried to directly address the problem.
Kevin Albrecht
@Kevin Did you try to create an empty project with nothing but a couple of draggable web parts? That's what I did and it worked fine in Firefox. Sometimes "parental" CSS rules that tweak things such as `position` and can wreak havoc on other sections of the site. These situations are difficult enough to debug that you want to make sure that is the exact issue before starting to fix it. Creating a dummy project is one way to do that.
Josh Stodola
A: 

Dear kevin, I don't know how's your application state but I strongly recommand to use something like Google IG page web part style. this is a light and heavy control which works fine with all of available browsers!

you can find a complete description onHow to create a google ig style page at:

http://userscripts.org/scripts/review/2279

note that this is a opensource Greasemonkey script.

you can also find a similar project at codeproject

http://www.codeproject.com/KB/ajax/MakingGoogleIG.aspx?msg=3098239

hope this help

Nasser Hadjloo
wow, thanks a lot its resolved my same issue, tnx tnx tnx
+1  A: 

It seems to me that asp.net ajax is not a right tool to do this job. It's too ugly and heavy. I've implemented similar task using ExtJs (click here for a sample). ExtJs is a very powerful js library for RIA. It's was very easy and fast to implement and there was no pain - the code of a library is almost perfect and the documentation really rocks.
Also you can try to implement your web part with JQuery (webparts with JQuery) and JQuery UI. But it will be much more harder in comparison with ExtJs.

(02/17/2010)
I strongly recommend not to use asp.net ajax for this task. It's very hard to debug. JS code of the library IMO is ugly and has a lot of pitfalls and it doesn't allow easy customization. And this is why I recommend to use some different approach. But if you want you can check the source of Dropthings web portal. It uses asp.net ajax but it's highly customized. And it works in FF, Chrome, Opera. Here is the demo.

zihotki
This only explains the implementation of individual web part functionality and has nothing to do with the particular bug I am experiencing: inability to drag and drop in non-IE browsers.
Kevin Albrecht
@Kevin: My recommendation is avoid asp.net ajax as much as possible because it's very hard to debug. JS code of the library IMO is ugly and has a lot of pitfalls and it doesn't allow easy customization. And this is why I recommend to use some different approach.
zihotki
My problem is unrelated to ASP.NET AJAX. Dragging and dropping web parts worked in IE before I started using ASP.NET AJAX at all.
Kevin Albrecht
zihotki
Based on the table in the first link you gave me -- http://geekswithblogs.net/dotNETvinz/archive/2009/06/01/comparison-between-standard-webparts-aspnet-futures-webparts-and-custom-webparts.aspx -- we were using the case in the top left of the table for a long time, which is no Ajax and no UpdatePanel. Drag and drop worked fine in IE. We only later upgraded to ASP.NET AJAX and the same problem continued.
Kevin Albrecht
+3  A: 

This might look like a silly question but, if you add the following HTML code to your page:

<div style="background-color: red; padding: 50px; width: 100px;">&nbsp;</div>
<div style="background-color: green; width: 100px;">&nbsp;</div>

Is the red box bigger twice as big as the green one?

If it isn't, you have an incorrect DOCTYPE that's causing the browsers to render the page in Quirks Mode, basically ending any hope you might have of it working across browsers.

If the size of the boxes is correct, do you get any error messages in the Firebug console when you try to drag and drop in Firefox?

And as a last two comments related to the others answers:

  1. If you can, I also recommend you to avoid asp.net ajax and use jQuery instead. You'll find much more info around the web, and it's much better documented IMO.
  2. Check the references in your project to verify that you really are using the latest version of ASP.Net Ajax. Even if your computer has the latest version of ASP.Net, your project might reference an older dll included in your bin directory (It happened to me once, so I should know!)
salgiza
Interesting idea, but the DOCTYPE is correct.
Kevin Albrecht
As I see you haven't actually found a solution, did you verify the version of the AjaxToolkit dll used by the project? Did you try to use Firebug to see if there where any javascript errors? (Josh idea of creating a blank project it's also quite a good one). Regardless of the fact that the bounty expired, it would be nice to know that you found a solution!
salgiza
A: 

Have you checked out JQuery drag and drop support? It works on all the browsers which support Drag and Drop operations and it is pretty easy to implement.

http://www.highoncoding.com/Articles/381_Drag%20And%20Drop%20With%20Persistence%20Using%20JQuery.aspx

azamsharp
Fortunately or unfortunately, that is not an option for our project.
Kevin Albrecht