Data dodania Pytanie
2017-06-19 23:06 Getting Current User Id in AspNet Core »
So far in Asp.Net I have used this command to get current username var currentUsername = !string.IsNullOrEmpty(System.Web.HttpContext.Current?.User?....
(0) odpowiedzi
2017-06-19 20:06 URL not passing argument to method »
Here is my RouteConfig: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes...
(1) odpowiedzi
2017-06-19 15:06 Xamarin form validation and ASP.Net WebAPI »
I have a Xamarin.Form app, and I am consuming an ASP.Net Web WebAPI with Model State for validation in my internal models. If I got a "bad request" my...
(1) odpowiedzi
2017-06-19 14:06 How to get value from an input control on a View (MVC) »
I'm working on small mvc application, and on one point I need a value from my Controller's Method, and my plan is to store that value in a ViewBag and...
(2) odpowiedzi
2017-06-18 23:06 Does MVC and WebApi controller share route table? »
Seems by error, I had put my config.Routes.MapHttpRoute(...) under RouteConfig.RegisterRoutes(...) instead of WebApiConfig.Register(...). But even the...
(1) odpowiedzi
2017-06-18 20:06 List<> does not contain the definiton for getAwaiter »
I am implementing automapper in my asp.net webapi project. I have also implemented async tasks in the business layer. I basically want to return Mov...
(1) odpowiedzi
2017-06-17 17:06 Multiple errors on _Layout.cshtml in ASP Core »
I have an ASP Core application. It builds and runs without any problems but Visual Studio is showing lots of errors: | Severity | Code | Descr...
(0) odpowiedzi
2017-06-17 10:06 User.Identity.Name is returning UserName instead of Name »
I want to display Name of a user instead of UserName in navbar that is in _LoginPartial Currently I'm using User.Identity.GetUserName() for userName ...
(1) odpowiedzi
2017-06-17 00:06 MVC Web API, Error: Can't bind multiple parameters »
I get error when passing the parameters, "Can't bind multiple parameters" here is my code [HttpPost] public IHttpActionResult GenerateToken([F...
(1) odpowiedzi
2017-06-16 19:06 Conditional OnClick With Razor in MVC C# »
I have a variable named wURL which contains a URL. If the URL is NULL I would like to not have the onclick Event in my TD. My trouble is figuring ou...
(3) odpowiedzi
2017-06-16 14:06 Jquery Function always return count 0 of second parameter »
i am writing a function in jquery which post the data to controller. currently it is posting form data to controller fine but when i post checkbox lis...
(2) odpowiedzi
2017-06-16 13:06 MVC 5 - Prevent user from creating record in One to (0..1) relationship if a previous record exists. »
So I have a Customers model which needs to have a one to zero-or-one relationship with AspNetUsers. The way I want this to work is for a user to regis...
(1) odpowiedzi
2017-06-15 23:06 Separate variables in cshtml »
I have two nested C# for loops in cshtml and I want to concatenate the variables i and j with an underscore in a button tag. I've tried the following:...
(1) odpowiedzi
2017-06-15 23:06 How do I create a nested object from the container object's create controller/view in MVC? »
I am new to MVC and am struggling to get my head round it coming from a web forms background. I have two classes for a timesheet application, Week an...
(0) odpowiedzi
2017-06-14 17:06 How to render HTML content coming from Model »
So, I have a wordpress like website in ASP.Net MVC 5, where I can create website for my customers. Now one of the customer's website needed a text box...
(1) odpowiedzi
2017-06-14 14:06 How to pass a Javascript List object in @Html.Raw(@Url.Action())? »
How do I pass a Javascript list object in @Html.Raw(@Url.Action()) ? I have a Model in my controller which has the following properties as the js Li...
(2) odpowiedzi
2017-06-13 21:06 Retrieve URL from MVC ViewData in jQuery »
Struggling with this a bit. I'm passing an absolute URL from the controller to View and trying to retrieve the URL in the jquery to pass it to an Ajax...
(2) odpowiedzi
2017-06-13 18:06 C# Insertion Order into List from Entity Framework »
I was surprised to see that I am having insertion order issues into a C# list when instantiating it from an Entity Framework Select. I am creating mu...
(1) odpowiedzi
2017-06-13 04:06 Javascript in a View Component »
I have a View Component that contains some jQuery in the Razor (.cshtml) file. The script itself is quite specific to the view (deals with some some c...
(1) odpowiedzi
2017-06-12 17:06 How to pass current Url with query strings into Html.ActionLink() function in MVC »
On the https://www.willistowerswatson.com/en/press page, select "Exchange Solutions" in the "Services" facet, and note how the query string changes to...
(1) odpowiedzi
2017-06-12 16:06 Header can't pass in ajax using cross domain »
I have used two project for my site. One for Mvc project and Api project. I have added below code in web.config file which is in Api project, Access-...
(2) odpowiedzi
2017-06-12 14:06 Knockout: Click button created server side »
I have a razor view with a partial view inside. Within ProductBooking partial I am sending the data and creating a list of prices in a controller, ad...
(1) odpowiedzi
2017-06-12 10:06 how to increment object property name in a loop »
in my list of objects i have few similar properties. week1 week2 week3 week4 week5 ... I would like to be able to display them in a table based on ...
(2) odpowiedzi
2017-06-12 02:06 .NET MVC Get info from Partial views »
I am pretty new to MVC and doing a project for a charity. The project is a basic order management service. It doesn't need to be overly complicated th...
(1) odpowiedzi
2017-06-11 17:06 Use Angular Id value from ng-reapt in a razor @Url.Action link »
I am trying to pass values to my controller action from link in View: Controller: public ActionResult Details(DetailsViewModel vm) { if (vm.CarI...
(1) odpowiedzi
2017-06-11 17:06 Could not install package 'Microsoft.AspNet.Razor 3.2.3' in Visual Studio 2015 Nuget package manager »
I tried the following: I am trying to open a code set created in VS 2010 (pluralsight exercise) in VS Community 2015. The System.Web.Mvc reference ...
(1) odpowiedzi
2017-06-11 01:06 Custom Relative Path In Asp.Net Core MVC »
Is there any possibility to have a custom relative path same as example at below: In Razor: <script src="%/scripts/theme.js" type="text/javascrip...
(2) odpowiedzi
2017-06-10 21:06 ASP MVC WebApi returns error 'not found' »
"<!DOCTYPE html> <html> <head> <title>The resource cannot be found.</title> <meta name="viewport"...
(1) odpowiedzi
2017-06-10 18:06 Runtime compile other files than cshtml views »
I'm working on an ASP.NET MVC 5 + WebAPI 2 application. For flexibility purposes, the stakeholders insist that the integration guys should be able to ...
(0) odpowiedzi
2017-06-10 06:06 Binding to a Readonly property which returns another property in mvc »
Let's say I have an Entity with 3 properties A, B, and C of same complex data-type. Now I have defined another not mapped, read-only property D of the...
(0) odpowiedzi
2017-06-09 16:06 html.hiddenfor error when rendering view outside controller as string »
I need server side page render (without request) outside controller(I want to render view outside controller). To do that, i need a fake HttpRequest...
(0) odpowiedzi
2017-06-09 13:06 MVC - Generic Actions »
I've got a page in an app I'm building. The page contains a few bits and pieces, then a partial view that loads a different view depending on what's s...
(0) odpowiedzi
2017-06-08 21:06 Unable to call @Html.Action() in jQuery »
I'm trying to get the html from one of my partial views into a div tag with the id "searchpage" in my main view. However, when I follow the syntax in ...
(3) odpowiedzi
2017-06-08 14:06 MVC Model Binding Complex Type to Action Parameter »
I'm binding a list of customers into a customer search results page using the model binding of MVC3, and using Razor to render all the customers in a ...
(1) odpowiedzi
2017-06-07 19:06 asp.net web API change JSON date format to UTC »
How can I change JSON date format to UTC automatically? now when I get data from server included dates, it returns as local zone date. I know I can c...
(1) odpowiedzi