Click here to Skip to main content
15,890,506 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Question@Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14314-Jun-16 10:02
indian14314-Jun-16 10:02 
AnswerRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
jkirkerx15-Jun-16 7:24
professionaljkirkerx15-Jun-16 7:24 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14315-Jun-16 8:06
indian14315-Jun-16 8:06 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
jkirkerx15-Jun-16 13:09
professionaljkirkerx15-Jun-16 13:09 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14315-Jun-16 23:05
indian14315-Jun-16 23:05 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14316-Jun-16 9:08
indian14316-Jun-16 9:08 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
jkirkerx16-Jun-16 10:37
professionaljkirkerx16-Jun-16 10:37 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14316-Jun-16 16:52
indian14316-Jun-16 16:52 
Yes I am passing the model still it gives me error saying "Name model doesn't exist in current context" at the place where I am mentioning @model

Here is my View
@*@using MVCWithWebApiApp.Models

@model MVCWithWebApiApp.Models.User

@{
    ViewBag.Title = "Index";
}*@

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Users Details</title>
    <script src="~/Scripts/jquery-2.2.4.min.js"></script>
    <script src="~/Scripts/angular.min.js"></script>
    <script src="~/Scripts/myApp.js"></script>
</head>

<body>
    <h2>Index</h2>
    <div data-ng-app="myApp" data-ng-controller="userController">
        <table style="border:none 0px gray;">
            <tr>
              <td>
        <table style="border:solid 1px gray;">
            <tr>
                <td style="border:solid 1px gray;">User Id</td>
                <td style="border:solid 1px gray;">User Name</td><br />
            </tr>
            <tr data-ng-repeat="usr in users">
                <td>{{usr.UserId}}</td>
                <td>{{usr.UserName}}</td><br />
            </tr>
        </table>

<pre>
            </td>
            <td>
                <a class="btn btn-primary" href="@Url.Action("AddressesBilling", "Admin", new { caID = Model.CustomerID, baID = address.BillingID })" data-toggle="tooltip" data-placement="bottom" title="Edit the customers billing address" data-original-title="Edit the customers billing address">Edit</a>
            </td>
        </tr>
    </table>


</body>
</html>

And my controller I have added this code still it doesn't help me.
public ActionResult CreateUser()
{
    User user = new User();
    user.UserId = 1;
    user.UserName = "Abdul";

    return View(user);
}

Am I making any error in my Web.Config here I am putting it here, any suggestion helps me
<?xml version="1.0"?>

<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages><br />
  </system.web.webPages.razor>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
    <add key="webpages:Version" value="2.0.0.0" />
  </appSettings>

  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>

<pre>
<pages
    validateRequest="false"
    pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <controls>
    <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />        
  </controls>
</pages>    



<system.webserver>
<validation validateIntegratedModeConfiguration="false" />

<handlers>
  <remove name="BlockViewHandler"/>
  <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>




Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14316-Jun-16 22:45
indian14316-Jun-16 22:45 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
jkirkerx17-Jun-16 5:54
professionaljkirkerx17-Jun-16 5:54 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14317-Jun-16 9:15
indian14317-Jun-16 9:15 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
jkirkerx19-Jun-16 7:07
professionaljkirkerx19-Jun-16 7:07 
Question.NET Oracle.DataAccess.Client Pin
Karan_TN14-Jun-16 3:52
Karan_TN14-Jun-16 3:52 
AnswerRe: .NET Oracle.DataAccess.Client Pin
John C Rayan14-Jun-16 4:22
professionalJohn C Rayan14-Jun-16 4:22 
Question.net Pin
Member 1257929012-Jun-16 7:59
Member 1257929012-Jun-16 7:59 
AnswerRe: .net Pin
Richard MacCutchan12-Jun-16 23:00
mveRichard MacCutchan12-Jun-16 23:00 
AnswerRe: .net Pin
F-ES Sitecore12-Jun-16 23:32
professionalF-ES Sitecore12-Jun-16 23:32 
AnswerRe: .net Pin
Richard Deeming13-Jun-16 2:05
mveRichard Deeming13-Jun-16 2:05 
GeneralRe: .net Pin
ZurdoDev15-Jun-16 9:40
professionalZurdoDev15-Jun-16 9:40 
AnswerRe: .net Pin
John C Rayan14-Jun-16 4:24
professionalJohn C Rayan14-Jun-16 4:24 
Question.net Pin
Member 1257929012-Jun-16 7:57
Member 1257929012-Jun-16 7:57 
QuestionWell after the last 5 days, I feel unchained from the Microsoft ball now! MVC with Bower, NPM and Gulp and Docker Pin
jkirkerx10-Jun-16 7:35
professionaljkirkerx10-Jun-16 7:35 
PraiseRe: Well after the last 5 days, I feel unchained from the Microsoft ball now! MVC with Bower, NPM and Gulp and Docker Pin
John C Rayan14-Jun-16 4:51
professionalJohn C Rayan14-Jun-16 4:51 
GeneralI went ahead and upgraded to Windows 10 and VS2015 Pin
jkirkerx15-Jun-16 7:42
professionaljkirkerx15-Jun-16 7:42 
GeneralRe: I went ahead and upgraded to Windows 10 and VS2015 Pin
John C Rayan15-Jun-16 22:08
professionalJohn C Rayan15-Jun-16 22:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.