Click here to Skip to main content
14,872,753 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCould not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
Otekpo Emmanuel2-Aug-16 6:33
MemberOtekpo Emmanuel2-Aug-16 6:33 
AnswerRe: Could not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
jkirkerx2-Aug-16 9:19
professionaljkirkerx2-Aug-16 9:19 
GeneralRe: Could not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
Otekpo Emmanuel3-Aug-16 7:16
MemberOtekpo Emmanuel3-Aug-16 7:16 
GeneralRe: Could not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
jkirkerx3-Aug-16 7:40
professionaljkirkerx3-Aug-16 7:40 
QuestionRegarding DataTable width Pin
harikreddy31-Jul-16 21:48
Memberharikreddy31-Jul-16 21:48 
QuestionRe: Regarding DataTable width Pin
Richard MacCutchan31-Jul-16 22:24
mveRichard MacCutchan31-Jul-16 22:24 
AnswerRe: Regarding DataTable width Pin
ZurdoDev1-Aug-16 8:11
professionalZurdoDev1-Aug-16 8:11 
QuestionAngularjs is not refreshing data on the CSHTML page Pin
indian14330-Jul-16 14:28
Memberindian14330-Jul-16 14:28 
Hi All,

I am writing my AngularJS - js file as below and using ng-repeat as well as below, but when I add or remove item into the list angularJS is not refreshing it automatically on View, am I missing something, it is happening on IE but on Chrome its refreshing the list automatically. Am I missing something or do I need to explicitly refresh the list etc to show the most updated list on IE, I have to use only IE at my work - please any help is appreciated thank you.

Here is my View
<body><br />
   <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><a href="/User/UpdateUser/{{usr.UserId}}"> {{usr.UserId}} </a> </td>
                <td><a href="/User/UpdateUser/{{usr.UserId}}">{{usr.UserName}}</a></td><br />
            </tr>
        </table>

<pre>
            </td>
            <td>
                 <a href="http://www.codeproject.com/Members/html">@Html</a>.ActionLink("Create User", "CreateUser")
            </td>
        </tr>
    </table>


</body>


And here is my script
var myApp = angular.module('myApp', []);

myApp.controller('userController', ['$scope', '$http', function ($scope, $http) {
    $scope.users = "";
    $http.get("/User/GetUsers")
    .success(function (result) {        
        $scope.users = result;
    })
    .error(function (result) {
        console.log(result);
    });
}]);

Here is my Controller Action method, when an item is added to the list, it will call the Idex method which calls this AngularJS function but some how the function is not getting called and the update on the View is not showing up, please help me.
//
// GET: /User/Create
public ActionResult CreateUser()
{<br />
    return View();
}

//
// POST: /User/Create
[HttpPost]
public ActionResult CreateUser(FormCollection collection)
{
    try
    {
        string Id = Request.Form["UserId"];
        string UserName = Request.Form["UserName"];
        int UserId;

        var dbContext = new MVCDBContext();
        User user = new User();
        user.UserId = (int.TryParse(Id, out UserId) ? UserId : 0);
        user.UserName = UserName;

        dbContext.Users.Add(user);
        dbContext.SaveChanges();

        return RedirectToAction("Index");
    }
    catch
    {
        return View();
    }
}

Thanks in advance.
Thanks,

Abdul Aleem

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


modified 31-Jul-16 5:00am.

AnswerRe: Angularjs is not refreshing data on the CSHTML page Pin
Richard Deeming1-Aug-16 2:08
mveRichard Deeming1-Aug-16 2:08 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
indian1431-Aug-16 6:56
Memberindian1431-Aug-16 6:56 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
Richard Deeming1-Aug-16 6:59
mveRichard Deeming1-Aug-16 6:59 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
indian1431-Aug-16 7:57
Memberindian1431-Aug-16 7:57 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
Richard Deeming1-Aug-16 8:23
mveRichard Deeming1-Aug-16 8:23 
AnswerRe: Angularjs is not refreshing data on the CSHTML page Pin
Nathan Minier1-Aug-16 4:02
professionalNathan Minier1-Aug-16 4:02 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
indian1431-Aug-16 6:45
Memberindian1431-Aug-16 6:45 
QuestionHow can I print from web application in asp.net mvc ? Please check "PrintFromWebApplication" document. pdf PrintFromWebApplication [PDF/274KB] http://download.brother.com/pub/com/dev/pdf/bpac_webapplication_eng.pdf Pin
Nguyen Jay28-Jul-16 3:07
MemberNguyen Jay28-Jul-16 3:07 
QuestionRe: How can I print from web application in asp.net mvc ? Please check "PrintFromWebApplication" document. pdf PrintFromWebApplication [PDF/274KB] http://download.brother.com/pub/com/dev/pdf/bpac_webapplication_eng.pdf Pin
ZurdoDev28-Jul-16 3:37
professionalZurdoDev28-Jul-16 3:37 
AnswerRe: How can I print from web application in asp.net mvc ? Please check "PrintFromWebApplication" document. pdf PrintFromWebApplication [PDF/274KB] http://download.brother.com/pub/com/dev/pdf/bpac_webapplication_eng.pdf Pin
Nguyen Jay28-Jul-16 4:43
MemberNguyen Jay28-Jul-16 4:43 
GeneralRe: How can I print from web application in asp.net mvc ? Please check "PrintFromWebApplication" document. pdf PrintFromWebApplication [PDF/274KB] http://download.brother.com/pub/com/dev/pdf/bpac_webapplication_eng.pdf Pin
F-ES Sitecore28-Jul-16 23:31
mveF-ES Sitecore28-Jul-16 23:31 
GeneralHow to create CRUD operation using WebService and call it in mvc4 Pin
sunil327-Jul-16 0:57
Membersunil327-Jul-16 0:57 
GeneralRe: How to create CRUD operation using WebService and call it in mvc4 Pin
Richard MacCutchan27-Jul-16 3:04
mveRichard MacCutchan27-Jul-16 3:04 
QuestionMerge images in .net mvc5 Pin
Member 1047586026-Jul-16 3:09
MemberMember 1047586026-Jul-16 3:09 
AnswerRe: Merge images in .net mvc5 Pin
F-ES Sitecore26-Jul-16 23:28
mveF-ES Sitecore26-Jul-16 23:28 
QuestionPage Load Error Pin
narukullavamshi24-Jul-16 23:57
Membernarukullavamshi24-Jul-16 23:57 
AnswerRe: Page Load Error Pin
Richard Deeming25-Jul-16 0:55
mveRichard Deeming25-Jul-16 0:55 

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.