c# - How to undo strongly typed view? -


OK so I'm working with an ASP.NET MVC 3 project. When I first started learning C # ASP.NET, I created a strongly typed view for the action of a controller. However, now I realized that I do not need that model (model which my idea was strongly typed) how can I get rid of the model now? I tried to separate it from the project, but when I compile my project in VS-2010, it says that page was not found . Is there a way to undo the strongly typed part in VS2010 and is still able to keep and display stuff in my opinion?

  @ intranet Ares ROC Models. Visual model; @ * This is for SiteLookupVM @ @ {layout = "~ / visible / shared / _LayoutIntranet.cshtml"; } & Lt; Div id = "md pageHdr" & gt; Fine Save Metrics & lt; / Div & gt; @ Html.Partial ("_ PartialSiteLookup", (SiteLookupVm) ViewBag.SiteLookup) @if (ViewBag.SiteId> 0) {@ Html.ActionLink ("Bounce Matrix", "BounceMetrics", "Metric", New {siteId} = @ ViewBag.SiteId}, null) @ html.partial ("_partialchartdisplay")} other {& lt; Div id = "tabs wrapper" & gt; & Lt; Ul id = "tabs_menu" & gt; & Lt; Li & gt; @html.exelink ("page load", "index", blank, new {id = "active"}) & lt; / Li & gt; & Lt; Li & gt; @HTMLconnect ("Matrix Data", "DashMatrix") & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Div id = 'dashboard' & gt; @html.party ("_ Partial Metrics Dashboard") & lt; / Div & gt; }   

Action

  Protected Metrics DashboardRepository _mdr = New MetricsDashboardRepository (); Private Load History DBEntities DB = New LoadHistoryDBINT (); Private Availability Reference Reference = New Availability Edit (); Public Action Result Index (Int Sitemed) {SiteLookupVm SiteLookup = New SiteLookupVm (); SiteLookup.ActionName = "index"; SiteLookup.ControllerName = "Matrix"; ViewBag.SiteLookup = SiteLookup; ViewBag.Title = "FNS Matrix"; If (SiteId = Null & amp;! & SiteId> 0) {string site = new WPDE ()) Sites.Where (r = & gt; r.SiteId == SiteId) .Select (r = & gt; r.Name) .FirstOrDefault (); SiteLookup.CurrentSite = site == Faucet? "Site does not exist": Site; ViewBag.SiteId = SiteId; ViewBag.FnsId = db.fns_sites.Where (f = & gt; f.3id == SiteId & amp; amp; f.enabled) .Select (s => s.id). FirstOrDefault (); ViewBag.RegionData = context.Regions.ToList (); ViewBag.PathData = Reference. Testpath .Oolist (); } And {_mdr.DashSetup (); ViewBag.mdr = _mdr; VietGuadet = 30; ViewBag.order = 0; ViewBag.totPageView = _mdr.TotPageView (); ViewBag.totMonthUni = _mdr.TotMonthUni (); } See Return (); }    

At the top of your view, you should look something like this:

Razor:

  @model YourType   

ASPX:

  & lt;% @page language = " C # "Inheritance =" System.Web.Mvc.ViewPage   

If this is a razor, then delete that line. YourType & gt; For & lt; If this is ASPX, change & lt is dynamic & gt;

Regards

Comments