why ScriptManager is not recognized by VS?

Last post 12-14-2007 6:32 PM by tamizhppiriyan. 3 replies.

Sort Posts:

  • why ScriptManager is not recognized by VS?

    12-14-2007, 4:03 PM
    • Member
      8 point Member
    • taowang
    • Member since 11-26-2007, 1:28 AM
    • Posts 37

    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):

    <%@ 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

  • Re: why ScriptManager is not recognized by VS?

    12-14-2007, 5:10 PM
    Answer

    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...
     

    http://dotnet-tips.blogspot.com/
  • Re: why ScriptManager is not recognized by VS?

    12-14-2007, 6:24 PM
    • Member
      8 point Member
    • taowang
    • Member since 11-26-2007, 1:28 AM
    • Posts 37

    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

  • Re: why ScriptManager is not recognized by VS?

    12-14-2007, 6:32 PM

    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 :)

    http://dotnet-tips.blogspot.com/
Page 1 of 1 (4 items)