Drop Things to Web Application

May 29, 2008 at 3:32 PM
Hi, i was wondering if anyone could please point me in the right direction with this small problem.

I have installed and run the Drop Things website in VS 2008 and everyhing works fine. Problem is, I am having issues after converting it to a web application.

The site runs but, the drag and drop functionality doesnt work and i keep getting various JS errrors when trying to do other tasks.

I have changed the 'this.captureScripts = false;' to true, in the ScriptDefer class and that enables the drag and drop but it doesnt drop correctly. I.e. the widgets to dont reflow to fit the page properly, they mostly just sit on each other. Other tasks have similar issues but the interesting errors i get in Firefox Firebug point to a problem with the PageService and WidgetService web services.

When i try and open either of these web services code behinds i get a VS2008 error saying that the designer view cannot be safely created. This points to the WebServiceBase WS that both these services inherit from. The protected insatnce of UserProfile is the offending line of code.

Has anyone any ideas on the correct procedure in running this app as a web application?

Thanks in advance.
May 29, 2008 at 9:24 PM
Re-download a fresh copy of the project to a directory on your computer.  In VS2008, choose Open Website and point to the Dropthings.sln   under the Trunk directory. Restore the database to your SQL Server 2005. That is all you should need to do. No need to try and convert it to a web application or anything. Also, you don't need an IIS virtual directory either on your PC.
May 29, 2008 at 10:31 PM

cheers for the reply. Unfortunately, im trying to shoe horn this funcitonality into a Content Management System with the drop things functionality on the homepage (with a lot of customisation). So, i have to convert it to a WAP.

Im thinking it has something to do with the Web Services using the Profile object to access certain profile propertys as the error im getting, in Firebug, is telling me that PageService and WidgetService are not assigned. When i try to open either of these in VS, im getting a VS designer error like a mentioned before so, im guessing the fault lies there.

I have tried invoking the web services manually, passing in valid paramaters and they seem to work fine, its just when the code drops into the Masterframework.js and tries to call them there, i.e. when you move a widget, delete a widget etc.

Oct 15, 2008 at 1:33 PM
I have converted DropThings to a WAP for integration into a CMS. It works great in Mozilla Firefox and Opera, but for some reason when I attempt to drag items in MSIE, they get instantly offset a huge amount of screen real estate. I read one post on absolute positioning, but got completely lost. Any clues?

-Kenneth S Courtney
Oct 27, 2008 at 3:58 AM

I am having less luck converting DropThings to a WAP. My first issue is with the Profile.UserName as it does not exist in the current context (which is true) however I am unable to get my head around making it work in the same way. I have used the WebProfileBuilder to generate a new class to try and functionm the same way the auto generated ProfileCommon works. I seem to be missing something obvious I think.

This is related to the UserProfile class extension.

Any advise would be gratefully appreciated.

Oct 27, 2008 at 6:43 PM

Hi xidix,

I too had awful trouble getting this working as a WAP to begin with. The first thing to do is to make sure that this line is on your web.config:

<profile enabled="true" automaticSaveEnabled="false" defaultProvider="DashboardProfileSqlProvider" inherits="Personalisation.Functions.UserProfile">

The important bit is the ‘Inherits’ property. This has to be set to namespace.UserProfile.

I have changed the whole website to a User Control. In the code behind of the User Control add this to your private fields:

UserProfile Profile = null;

Then, in the OnInt() event, add this:

Profile = HttpContext.Current.Profile as UserProfile;

After this, you should be able to access the Profile object. I spent time trying to generate another class with the WebProfileBuilder and realised I was wasting my time. The class has already been created for you.

Hope this helps.

Stephen Farrell
Web Developer

Redweb Ltd
t: 01202 779944 f: 01202 773643
e: stephenfarrell@redweb.com

Visit us at www.redweb.com
Main office: 35 Holdenhurst Road, Bournemouth, Dorset BH8 8EJ
London Office: 7-15 Rosebery Ave, Clerkenwell, London, EC1R 4SP

ISO logos and NMA Top 100 logo

This communication may contain information that is privileged and confidential. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is prohibited. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Redweb, for any loss or damage arising from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety. Thank you.
Redweb is registered in England at Bank Court, Manor Road, Verwood, Dorset, BH31 6DY. Registration No. 3420895

This message has been scanned for viruses by SurfControl
Oct 30, 2008 at 6:22 PM
Hi RedWebSteve,

Thank you so much. That seems to have done the trick. I have not taken the step yet to put everything into one user control however that was the plan. I was trying to get the proof of concept running first.

Now I seem to have trouble with my own js. My onLoadHandler() and DropThingsUI can not be referenced. Shortly after the DataListAdapter the RenderContents method is causing me trouble as the datalist seems to not be created correctly. This means that it falls over almost immediately due to things like RepeatColumns being 0.

Can you share your experience in any further detail?

Many thanks again.