Showing posts with label drop. Show all posts
Showing posts with label drop. 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 :)

Why ScriptManager in MasterPage is not enough to the toolkitExtender control?

This is the error I get when look on a page and drop the User control that include the ajaxTooltip from any type.

Any suggestion?

The Error

Do you use ScriptMangerProxy?you need to use ScriptManager/ ScriptManagerProxy both for master page.

Where to add the ScriptManager and where to add the ScriptManagerProxy to get a clear design time project developing?

To explain the controls, pages, masters I have, here are they:

1. A master page that include a ScriptManager (I try to include a ScriptManagerProxy also).

2. A page that inherit the MasterPage and have a User Control in it by design time(drag and drop).

3. A User Control that have a modalPopupExtender in it, that work properly.

My only problem that other developers use my User Control in them Pages and the User Control(that added to the page) raise a:

Error Rendering Control

An unhandled exception has occurred.

The control with ID 'MpdalPopupExtender1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

What can I add to the Page, Master or may be web.config?

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.

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.