Showing posts with label drag. Show all posts
Showing posts with label drag. Show all posts

Wednesday, March 28, 2012

why ScriptManager is not recognized by VS?

Hi,

I drag and drop AJAX ScriptManager control to the source view of default.aspx, here is the code (the third and fourth lines are for ScriptManager):

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
Status:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Selected="True" Value="false">Active</asp:ListItem>
<asp:ListItem Value="true">Complete</asp:ListItem>
</asp:DropDownList>

But I found ScriptManager tag is underlined with curly red line. When I mouse hover on ScriptManager tag, I see a tip

Element ScriptManager is not a known element. This can occour if there is a compilation error in the website.

But I could compile and run the site successfully. The bugging thing is that all the AJAX control, such as UpdatePanel is not recognized by VS too.

any idea?

Thx

Tao

From what I know, this is what is happening...

The cause for this error is, in your web.config look for this tag...and change the tagprefix from default asp to anything else...

<controls>
<add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls
and now change the <asp:UpdatePanel> to <ajax:UpdatePanel> . All your errors should be gone.

please Let us know if this fixes...


This does solve the problem. But I don't understand why. Originally, the AJAX control defined in System.Web.Extensions is registered as tagPrefix = asp. So when I use asp:ScriptManager tag, VS should be able to locate the assembly and recognize it, theoritically. Do you know why I have to replace "asp" prefix with something else, such as ajax?

Thx

Tao


Theoretically I too expected the same. We found this fix on some blog(Thanks to him for posting it), I forget the link!. But it solved the dirty red squiggly lines and I made a note of it. May be, experts here can give hind sight of why and the details behind this...

Happy Coding :)

Monday, March 26, 2012

Will there be Visual Studio .NET 2005 Controls in the Toolbox?

Does anyone know if there are any plans to create drag and drop Atlas controls for the toolbox?All of the current Atlas server controls can be added using drag/drop and you can use the Visual Studio properties window to configure the components.

If the Atlas controls don't show up on your Toolbox, you can add them by dragging the Microsoft.Web.Atlas.dll from the Windows file manager to the toolbox or manually:

Right-click on Toolbox.

Saturday, March 24, 2012

Working Differently Remotely and Locally

Hi,
I'm just getting started with Atlas but and have a little sample working locally where I can drag an image around on the screen (little things...). When I upload to the server all I get is the page with none of the dragging ability.

I have installed .net framework 2.0 (before which the page didn't load at all) - is there anything else I need to do on the server?
It is a shared virtual server but I have admin remote desktop onto my share.

I'm sure it is a simple thing I've missed but I can't find out what it is.

Any help greatly appreciated.
Andrew

I assume you've uploaded the dll and web.config that you're using locally as well, right?

Can you provide a link to the online version? Who's the web host?

This problem when I've seen it before was a result of a problem with the WebResource.axd. In one case, the .dll was corrupt and so the resource was throwing out gibberish (you can see if that's the case by viewing yoru page's source after the server serves it and then copying and pasting the whole webresource.axd?...etc stuff into the address bar). In the other case, the host had a problem serving up the virtial file 'webresource.axd' and so I had to literally put a blank file named webresource.axd in the root of the site.

hope it helps

Paul

Wednesday, March 21, 2012

XML Script inside UpdatePanel: Not instantiated?

I have a bit of XML-Script (which assigns a Drag/Drop handle behavior to a control) that performs as expected. However, if I place this script inside an UpdatePanel then the script doesn't run. Is this a known issue? Any known workarounds? If not, can anyone provide me with insight on how the AJAX libraries identify and parse XML-script? E.g., Is there a function I can call that will reinitialize XML-Script blocks? Note: I can put a <script type="text/javascript" /> in an UpdatePanel and it'll execute as expected.

Jeremy

Bumping this thead. Any thoughts? Let me know if I need to clarify the request. The obvious work around is to just wire up the features using imperative syntax via Javascript, although this seems like a pretty obvious issue so I want to make sure I'm not missing something.


Can you please post the code you are using so I can take a look at it? Thanks


I later discovered that this functionality was by design and that any script (not just XML script) will not re-execute upon refresh of an UpdatePanel. There are a few work arounds posted for this on the internet which involve registering the script, probably via RegisterClientScriptBlock() or something similar. The approach didn't work for me, however, and I haven't had a chance to dive into this further yet. When I get a chance I will revisit this and post code samples and/or findings.