Showing posts with label scriptmanager. Show all posts
Showing posts with label scriptmanager. 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?

Wednesday, March 21, 2012

WYSIWYG-editor saying that a ScriptManager is not present when it is; throws an exception

Hey Guys,

I'm new to the AJAX Toolkit, so pardon me if my problem seems a bit dumb.

WYSIWYG Exception

As you can see in this image, I have a ScriptManager on the page, so I don't have a hot clue of what's really causing the problem. My HTML is all valid, and I can actually run the page through the built-in server and it works just fine.

Anyone have any ideas?

I'm not so sure but I think this could be caused by a wrong reference to the library that ajax uses (the Web.Extentions).

Try to remove the scriptmanager and just drag a new ScriptManager from the ToolBox to the top of the webpage. Then save the page, close it, and reopen it. Normally the design-view should render normally now.

I hope this helps!

Greets,
Wim