Partial view gives ambiguous reference errorHow do you give a C# Auto-Property a default value?The located assembly's manifest definition does not match the assembly referenceWhen is it appropriate to use C# partial classes?How to add an item from one datagrid to another then edit it in WPFPassing Data between View ControllersPass a simple string from controller to a view MVC3Error - Unable to access the IIS metabaseHow to include view/partial specific styling in AngularJSI cant get this form to send email or redirect to the correct viewSetting a column default value in the kendo ui grid to DateTime.Now

What does it mean with the ask price is below the last price?

Why did God specifically target the firstborn in the 10th plague (Exodus 12:29-36)?

What can cause a never-frozen indoor copper drain pipe to crack?

Control variables and other independent variables

Noob at soldering, can anyone explain why my circuit won't work?

The lexical root of the perfect tense forms differs from the lexical root of the infinitive form

Guns in space with bullets that return?

Can I use my laptop, which says 240V, in the USA?

Can the sorting of a list be verified without comparing neighbors?

Can 'sudo apt-get remove [write]' destroy my Ubuntu?

Will change of address affect direct deposit?

Looking for a simple way to manipulate one column of a matrix

What is the best way for a skeleton to impersonate human without using magic?

Ubuntu won't let me edit or delete .vimrc file

How can I make a vertical rule that extends to the edges of an fbox?

Is there a faster way to calculate Abs[z]^2 numerically?

What is the significance of 4200 BCE in context of farming replacing foraging in Europe?

Is a vertical stabiliser needed for straight line flight in a glider?

How to make a language evolve quickly?

Washer drain pipe overflow

Ex-manager wants to stay in touch, I don't want to

Are there variations of the regular runtimes of the Big-O-Notation?

What is the difference between "Plural" and "Mehrzahl"?

Two researchers want to work on the same extension to my paper. Who to help?



Partial view gives ambiguous reference error


How do you give a C# Auto-Property a default value?The located assembly's manifest definition does not match the assembly referenceWhen is it appropriate to use C# partial classes?How to add an item from one datagrid to another then edit it in WPFPassing Data between View ControllersPass a simple string from controller to a view MVC3Error - Unable to access the IIS metabaseHow to include view/partial specific styling in AngularJSI cant get this form to send email or redirect to the correct viewSetting a column default value in the kendo ui grid to DateTime.Now






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm trying to use a partial view to render the meta data and the header image (separate partial view) into the _layout.cshtml. While doeing this i get the following error: CS0104: 'Meta' is an ambiguous reference between 'Namespace.Models.Meta' and 'Umbraco.Web.PublishedContentModels.Meta'



I tried changing the name of Meta to evreything else, even non meaning keyboard spins like dfguyfgfjhagjhsgf. Still not working.



The meta.cs clase looks as follow:



using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Core.Models;
using Umbraco.Web;

namespace Namespace.Models

public class Meta

public Meta(IPublishedContent content)

Name = content.Name;

Description = content.GetPropertyValue<string>("metaDescription");
Photo = content.GetPropertyValue<IPublishedContent>("metaHeaderImage");


public IPublishedContent Photo get; set;
public string Name get; set;
public string Description get; set;





The Meta.cshtml looks as follow:



@model Meta
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>@Model.Name</title>
<meta name="description" content="@Model.Description">

<meta property="og:title" content="@Model.Name" />
<meta property="og:image" content="@Model.Photo" />


The call for the partial view in the _layout.cshtml is:



@Html.Partial("Meta", Model.Meta)



I would like to know what the error means and a possible solution would be great.



PS. I have done a project in the past with the same setup for partial views as this time. back then it worked just fine. No, i have no longer acces to this older project.










share|improve this question




























    1















    I'm trying to use a partial view to render the meta data and the header image (separate partial view) into the _layout.cshtml. While doeing this i get the following error: CS0104: 'Meta' is an ambiguous reference between 'Namespace.Models.Meta' and 'Umbraco.Web.PublishedContentModels.Meta'



    I tried changing the name of Meta to evreything else, even non meaning keyboard spins like dfguyfgfjhagjhsgf. Still not working.



    The meta.cs clase looks as follow:



    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Umbraco.Core.Models;
    using Umbraco.Web;

    namespace Namespace.Models

    public class Meta

    public Meta(IPublishedContent content)

    Name = content.Name;

    Description = content.GetPropertyValue<string>("metaDescription");
    Photo = content.GetPropertyValue<IPublishedContent>("metaHeaderImage");


    public IPublishedContent Photo get; set;
    public string Name get; set;
    public string Description get; set;





    The Meta.cshtml looks as follow:



    @model Meta
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>@Model.Name</title>
    <meta name="description" content="@Model.Description">

    <meta property="og:title" content="@Model.Name" />
    <meta property="og:image" content="@Model.Photo" />


    The call for the partial view in the _layout.cshtml is:



    @Html.Partial("Meta", Model.Meta)



    I would like to know what the error means and a possible solution would be great.



    PS. I have done a project in the past with the same setup for partial views as this time. back then it worked just fine. No, i have no longer acces to this older project.










    share|improve this question
























      1












      1








      1


      1






      I'm trying to use a partial view to render the meta data and the header image (separate partial view) into the _layout.cshtml. While doeing this i get the following error: CS0104: 'Meta' is an ambiguous reference between 'Namespace.Models.Meta' and 'Umbraco.Web.PublishedContentModels.Meta'



      I tried changing the name of Meta to evreything else, even non meaning keyboard spins like dfguyfgfjhagjhsgf. Still not working.



      The meta.cs clase looks as follow:



      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using Umbraco.Core.Models;
      using Umbraco.Web;

      namespace Namespace.Models

      public class Meta

      public Meta(IPublishedContent content)

      Name = content.Name;

      Description = content.GetPropertyValue<string>("metaDescription");
      Photo = content.GetPropertyValue<IPublishedContent>("metaHeaderImage");


      public IPublishedContent Photo get; set;
      public string Name get; set;
      public string Description get; set;





      The Meta.cshtml looks as follow:



      @model Meta
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">

      <title>@Model.Name</title>
      <meta name="description" content="@Model.Description">

      <meta property="og:title" content="@Model.Name" />
      <meta property="og:image" content="@Model.Photo" />


      The call for the partial view in the _layout.cshtml is:



      @Html.Partial("Meta", Model.Meta)



      I would like to know what the error means and a possible solution would be great.



      PS. I have done a project in the past with the same setup for partial views as this time. back then it worked just fine. No, i have no longer acces to this older project.










      share|improve this question














      I'm trying to use a partial view to render the meta data and the header image (separate partial view) into the _layout.cshtml. While doeing this i get the following error: CS0104: 'Meta' is an ambiguous reference between 'Namespace.Models.Meta' and 'Umbraco.Web.PublishedContentModels.Meta'



      I tried changing the name of Meta to evreything else, even non meaning keyboard spins like dfguyfgfjhagjhsgf. Still not working.



      The meta.cs clase looks as follow:



      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using Umbraco.Core.Models;
      using Umbraco.Web;

      namespace Namespace.Models

      public class Meta

      public Meta(IPublishedContent content)

      Name = content.Name;

      Description = content.GetPropertyValue<string>("metaDescription");
      Photo = content.GetPropertyValue<IPublishedContent>("metaHeaderImage");


      public IPublishedContent Photo get; set;
      public string Name get; set;
      public string Description get; set;





      The Meta.cshtml looks as follow:



      @model Meta
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">

      <title>@Model.Name</title>
      <meta name="description" content="@Model.Description">

      <meta property="og:title" content="@Model.Name" />
      <meta property="og:image" content="@Model.Photo" />


      The call for the partial view in the _layout.cshtml is:



      @Html.Partial("Meta", Model.Meta)



      I would like to know what the error means and a possible solution would be great.



      PS. I have done a project in the past with the same setup for partial views as this time. back then it worked just fine. No, i have no longer acces to this older project.







      c# model-view-controller umbraco






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 11:05









      Gino BlaazerGino Blaazer

      84




      84






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Ambiguous reference error comes when there are two classes with same name in your solution and the code cannot decide which one to use. In your case the class Meta is present in Namespace.Model and also Umbraco.Web.PublishedContentModels. You can change the Meta.cshtml file to refer the correct Meta class by using fully qualified class name like so.



          @model Namespace.Model.Meta





          share|improve this answer























          • Thank you very much. I knew it would be somthing small. Thanks for the help

            – Gino Blaazer
            Mar 23 at 11:35











          • Glad to help. Sometimes the smallest thing takes the longest time to debug!

            – Priyank Panchal
            Mar 23 at 11:38











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313041%2fpartial-view-gives-ambiguous-reference-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Ambiguous reference error comes when there are two classes with same name in your solution and the code cannot decide which one to use. In your case the class Meta is present in Namespace.Model and also Umbraco.Web.PublishedContentModels. You can change the Meta.cshtml file to refer the correct Meta class by using fully qualified class name like so.



          @model Namespace.Model.Meta





          share|improve this answer























          • Thank you very much. I knew it would be somthing small. Thanks for the help

            – Gino Blaazer
            Mar 23 at 11:35











          • Glad to help. Sometimes the smallest thing takes the longest time to debug!

            – Priyank Panchal
            Mar 23 at 11:38















          2














          Ambiguous reference error comes when there are two classes with same name in your solution and the code cannot decide which one to use. In your case the class Meta is present in Namespace.Model and also Umbraco.Web.PublishedContentModels. You can change the Meta.cshtml file to refer the correct Meta class by using fully qualified class name like so.



          @model Namespace.Model.Meta





          share|improve this answer























          • Thank you very much. I knew it would be somthing small. Thanks for the help

            – Gino Blaazer
            Mar 23 at 11:35











          • Glad to help. Sometimes the smallest thing takes the longest time to debug!

            – Priyank Panchal
            Mar 23 at 11:38













          2












          2








          2







          Ambiguous reference error comes when there are two classes with same name in your solution and the code cannot decide which one to use. In your case the class Meta is present in Namespace.Model and also Umbraco.Web.PublishedContentModels. You can change the Meta.cshtml file to refer the correct Meta class by using fully qualified class name like so.



          @model Namespace.Model.Meta





          share|improve this answer













          Ambiguous reference error comes when there are two classes with same name in your solution and the code cannot decide which one to use. In your case the class Meta is present in Namespace.Model and also Umbraco.Web.PublishedContentModels. You can change the Meta.cshtml file to refer the correct Meta class by using fully qualified class name like so.



          @model Namespace.Model.Meta






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 at 11:18









          Priyank PanchalPriyank Panchal

          724714




          724714












          • Thank you very much. I knew it would be somthing small. Thanks for the help

            – Gino Blaazer
            Mar 23 at 11:35











          • Glad to help. Sometimes the smallest thing takes the longest time to debug!

            – Priyank Panchal
            Mar 23 at 11:38

















          • Thank you very much. I knew it would be somthing small. Thanks for the help

            – Gino Blaazer
            Mar 23 at 11:35











          • Glad to help. Sometimes the smallest thing takes the longest time to debug!

            – Priyank Panchal
            Mar 23 at 11:38
















          Thank you very much. I knew it would be somthing small. Thanks for the help

          – Gino Blaazer
          Mar 23 at 11:35





          Thank you very much. I knew it would be somthing small. Thanks for the help

          – Gino Blaazer
          Mar 23 at 11:35













          Glad to help. Sometimes the smallest thing takes the longest time to debug!

          – Priyank Panchal
          Mar 23 at 11:38





          Glad to help. Sometimes the smallest thing takes the longest time to debug!

          – Priyank Panchal
          Mar 23 at 11:38



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313041%2fpartial-view-gives-ambiguous-reference-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현