ambiguous server tags

Last post 07-12-2008 2:18 PM by ieatskunk. 10 replies.

Sort Posts:

  • ambiguous server tags

    12-13-2007, 6:20 AM
    • Member
      point Member
    • mtanneryd
    • Member since 12-13-2007, 11:17 AM
    • Posts 6

    When I try to add a 3.5 Extension ListView server tag it complains about ambiguoity. I assume it is somehow in conflict with the "default" ListView. How do I get around this problem?

     

    /Måns

    Filed under:
  • Re: ambiguous server tags

    12-13-2007, 7:57 AM
    • Star
      7,686 point Star
    • Careed
    • Member since 06-24-2002, 7:37 AM
    • Lubbock, TX
    • Posts 1,499
    Explicitly include the namespace in the declaration: System.Web.UI.WebControls.ListView
    Christopher Reed
    "The oxen are slow, but the earth is patient."
  • Re: ambiguous server tags

    12-13-2007, 7:58 AM
    • Contributor
      2,384 point Contributor
    • datagrid
    • Member since 05-23-2007, 1:01 PM
    • USA
    • Posts 461

    Well, the new databound ListView control is available in 3.5 Framework. This is not part of 3.5 Extension Framework. 3.5 framework and 3.5 Extensions are two different releases.

    How are you declaring the ListView server control ? Can we please see your code?

    Do you have correct reference to the 3.5 framework DLL's in your web.config file ?

    Das (http://aspalliance.com/author.aspx?uId=697)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Dont forget to click "Mark as Answer" on the post that helped you. This marks your thread as Resolved so we will all know you have been helped.
  • Re: ambiguous server tags

    12-13-2007, 9:07 AM
    • Member
      point Member
    • mtanneryd
    • Member since 12-13-2007, 11:17 AM
    • Posts 6
    I created a project from the ASP.NET MVC project template. I tried to add the ListView simply by dragging it from the toolbox group "ASP.NET 3.5 Extensions" onto my MVC-View-Page-templated aspx page using the designer.
    Below is my web.config 
     
    <!-- 
        Note: As an alternative to hand editing this file you can use the 
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in 
        machine.config.comments usually located in 
        \Windows\Microsoft.Net\Framework\v2.x\Config 
    -->
    <configuration>
    	<configSections>
    		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
    					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    				</sectionGroup>
    			</sectionGroup>
    			<section name="dynamicData" type="System.Web.DynamicData.DynamicDataControlsSection" requirePermission="false" allowDefinition="MachineToApplication"/>
    		</sectionGroup>
    	</configSections>
    	<appSettings/>
    	<connectionStrings>
      <add name="NorthwindConnectionString" connectionString="Data Source=Lenny;Initial Catalog=Northwind;Integrated Security=True"
       providerName="System.Data.SqlClient" />
     </connectionStrings>
    	<system.web>
    		<!-- 
                Set compilation debug="true" to insert debugging 
                symbols into the compiled page. Because this 
                affects performance, set this value to true only 
                during development.
        -->
    		<compilation debug="true">
    			<assemblies>
    				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    			</assemblies>
    		</compilation>
    		<!--
                The <authentication> section enables configuration 
                of the security authentication mode used by 
                ASP.NET to identify an incoming user. 
        -->
    		<authentication mode="Windows"/>
    		<!--
                The <customErrors> section enables configuration 
                of what to do if/when an unhandled error occurs 
                during the execution of a request. Specifically, 
                it enables developers to configure html error pages 
                to be displayed in place of a error stack trace.
    
            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
        -->
    		<pages>
    			<controls>
    				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls" assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add tagPrefix="asp" namespace="System.Web.DynamicData" assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add tagPrefix="asp" tagName="DynamicFilter" src="~/App_Shared/DynamicDataFields/FilterUserControl.ascx"/>
    			</controls>
    			<namespaces>
    				<add namespace="System.Web.Mvc"/>
    				<add namespace="System.Linq"/>
    			</namespaces>
    		</pages>
    		<httpHandlers>
    			<remove verb="*" path="*.asmx"/>
    			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    		</httpHandlers>
    		<httpModules>
    			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="DynamicDataModule" type="System.Web.DynamicData.DynamicDataHttpModule, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="UrlRoutingModule" type="System.Web.Mvc.UrlRoutingModule, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    		</httpModules>
    	</system.web>
    	<system.codedom>
    		<compilers>
    			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    				<providerOption name="CompilerVersion" value="v3.5"/>
    				<providerOption name="WarnAsError" value="false"/>
    			</compiler>
    			<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    				<providerOption name="CompilerVersion" value="v3.5"/>
    				<providerOption name="OptionInfer" value="true"/>
    				<providerOption name="WarnAsError" value="false"/>
    			</compiler>
    		</compilers>
    	</system.codedom>
    	<system.web.extensions>
    		<!--
            <dynamicData
                // Type of the data context to be used
                dataContextType="[type]"
                enableTemplates="[bool]"  // whether to enable templates or not
                >
            
              <mappings
                queryStringKeyPrefix=""   // the prefix used for query string parameter keys
                pattern=""           // the pattern used in forming paths. must contains {table} and {viewName} identifiers
                >
                <add
                  actions="list|details" // can be comma-separated list
                  viewName=""       // string used in path pattern.
                  templateFile=""     // template to use if actual file does not exist. File path relative to App_PageTemplates
                  tables="[table names]"  // make these settings only apply to a list of tables (can be a comma-separated list)
                  path=""          // override the default path generated from the pattern. must be app relative
                  />
              </mappings>
            </dynamicData
        -->
    		<dynamicData dataContextType="" enableTemplates="false">
    			<mappings queryStringKeyPrefix="" pattern="~/{table}/{viewName}.aspx">
    				<add actions="list,details" viewName="ListDetails" templateFile="ListDetailsTemplate.aspx"/>
    				<!--
              <add actions="list" viewName="List" templateFile="ListTemplate.aspx" />
              <add actions="details" viewName="Details" templateFile="DetailsTemplate.aspx" />
            -->
    				<!--
              Special overriding cases
              <add actions="list,details" tables="Products,Categories" viewName="SpecialName" templateFile="ListTemplate.aspx"/>
              <add actions="list" tables="Products" templateFile="DetailsTemplate.aspx" path="~/customPath.aspx"/>
              <add actions="list" tables="Orders" viewName="MyListViewName"/>
            -->
    			</mappings>
    		</dynamicData>
    	</system.web.extensions>
    	<!-- 
            The system.webServer section is required for running ASP.NET AJAX under Internet
            Information Services 7.0.  It is not necessary for previous version of IIS.
      -->
    	<system.webServer>
    		<validation validateIntegratedModeConfiguration="false"/>
    		<modules runAllManagedModulesForAllRequests="true">
    			<remove name="ScriptModule"/>
    			<remove name="DynamicDataModule"/>
    			<remove name="UrlRoutingModule"/>
    			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="DynamicDataModule" preCondition="managedHandler" type="System.Web.DynamicData.DynamicDataHttpModule, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="UrlRoutingModule" type="System.Web.Mvc.UrlRoutingModule, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    		</modules>
    		<handlers>
    			<remove name="WebServiceHandlerFactory-Integrated"/>
    			<remove name="ScriptHandlerFactory"/>
    			<remove name="ScriptHandlerFactoryAppServices"/>
    			<remove name="ScriptResource"/>
    			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="MvcScriptMap" preCondition="classicMode" verb="*" path="*.mvc" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"/>
    			<add name="MvcHandler" preCondition="integratedMode" verb="*" path="Mvc.axd" type="System.Web.Mvc.MvcHandler, System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    		</handlers>
    	</system.webServer>
    	<runtime>
    		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    			<dependentAssembly>
    				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    				<bindingRedirect oldVersion="1.0.0.0-3.5.0.0" newVersion="3.6.0.0"/>
    			</dependentAssembly>
    			<dependentAssembly>
    				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    				<bindingRedirect oldVersion="1.0.0.0-3.5.0.0" newVersion="3.6.0.0"/>
    			</dependentAssembly>
    		</assemblyBinding>
    	</runtime>
    </configuration>
    
     
  • Re: ambiguous server tags

    12-13-2007, 9:15 AM
    • Contributor
      2,384 point Contributor
    • datagrid
    • Member since 05-23-2007, 1:01 PM
    • USA
    • Posts 461

    if you are using VS 2008 Professional or Team suite, can you please try the following:

    Right click on Project name and then go to Project Pages, go to Build secion in the window and choose the Target Framework as 3.5

     

    Das (http://aspalliance.com/author.aspx?uId=697)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Dont forget to click "Mark as Answer" on the post that helped you. This marks your thread as Resolved so we will all know you have been helped.
  • Re: ambiguous server tags

    12-14-2007, 8:52 AM
    • Star
      7,686 point Star
    • Careed
    • Member since 06-24-2002, 7:37 AM
    • Lubbock, TX
    • Posts 1,499

    I misunderstood earlier but now I see what's happening.  Unfortunately, I have not been able to recreate.  I would say that as long as you have the runtime element in your web.config is configured to account from version 3.5, it should matter which ListView from the Toolbox you use.  You might try uninstalling and reinstalling the Extensions again as well as deleting (or renaming) your current problematic project and solution directories to get a fresh start.

    What is the exact error message you're getting? 

    Christopher Reed
    "The oxen are slow, but the earth is patient."
  • Re: ambiguous server tags

    12-15-2007, 2:09 PM
    • Member
      point Member
    • mtanneryd
    • Member since 12-13-2007, 11:17 AM
    • Posts 6

     

    This is the error message I get.

    Error Creating Control - ListView1

    The server tag 'asp:ListView' is ambiguous. Please modify the assiciated registration that is causing ambiguity and pick a new prefix.

    Weird thing is, I don't necessarily get it all the time. If I create a new project and add an MVC View Page and immediately adds a version 3.6(ASP.NET 3.5 Extensions) ListView control it doesn't complain.

    Hmm, it seems as if it only complains if the following code is on my page. Looking at it it seems reasonable to me that it could cause problems, with the tagprefix thingerdinger and all.

     

    <%@ Register assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.WebControls" tagprefix="asp" %>

     Exactly how and why that row of code came into beeing in my page I do not know though, I guess I must have done something...

     

    /Måns

  • Re: ambiguous server tags

    12-17-2007, 12:21 PM
    • Star
      7,686 point Star
    • Careed
    • Member since 06-24-2002, 7:37 AM
    • Lubbock, TX
    • Posts 1,499

    You should not have this Register directive on your page.  It's causing the ambiguity because you're declaring both versions 3.5 and 3.6 of System.Web.Extensions.  Since you have it configured in the web.config, this shouldn't be needed.  If you can't make it go away, you can always change the tagprefix to something other than "asp".

    Christopher Reed
    "The oxen are slow, but the earth is patient."
  • Re: ambiguous server tags

    04-03-2008, 9:54 AM
    • Contributor
      2,716 point Contributor
    • gsuttie2002
    • Member since 09-07-2002, 10:17 AM
    • Scotland, UK
    • Posts 578

    Hi there, 
    I have added a blank page to the project dragged on a listview control and I get the exact same error

    Error 1 The server tag 'asp:ListView' is ambiguous. Please modify the associated registration that is causing ambiguity and pick a new tag prefix. C:\gregswork\LinqtoSql\Pages\TestListViewControl.aspx 3 

    Has this anything to do with me having asp net futures installed do you think ?

    Thanks for any asdvice

    Gregor Suttie
    MCSD, MCAD, MCSD.Net
  • Re: ambiguous server tags

    04-03-2008, 6:23 PM
    • Star
      7,686 point Star
    • Careed
    • Member since 06-24-2002, 7:37 AM
    • Lubbock, TX
    • Posts 1,499

    To an extent it does.  I have played around for the Futures a little.  I've noticed some inconsistency with what happens when you add a Futures control or an AJAX Toolkit control to the Design view, but this is probably associated with the way the web.config is set up.

    In your case, make sure that the dependentAssembly element is configured properly for the Futures ListView.  The bindingRedirect element should have oldVersion set to "1.0.0.0-3.5.0.0" and the newVersion set to "3.6.0.0".

    Christopher Reed
    "The oxen are slow, but the earth is patient."
  • Re: ambiguous server tags

    07-12-2008, 2:18 PM
    • Member
      4 point Member
    • ieatskunk
    • Member since 08-23-2007, 7:25 PM
    • California
    • Posts 2

    I had the same problem and this fixed it for me:

     <1>I changed the target framework to .net 3.5.

     <2>I removed web references that were added to a master page that referenced an old version of the new extensions.  The webform giving me the problems inherited from a master page that inherited from the one i removed the reference from.

     <3>I loaded the top level master page in the designer, then loaded the inherited masterpage, then loaded the webform that was giving me the problems.  It seemed the loading the pages in the designer in top-down inheritance order fixed the problem.

    N I C K
Page 1 of 1 (11 items)