uploading image asp.net Core

i am new to ASP.net COre and i would like to upload a file ( an image) and store it in a secific Folder. ihave been following this tuto https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads but i dont know how to store it in a file it ...
more »

2017-11-05 20:11 (2) Answers

Display FullName in _Layout.cshtml

In my MVC5 application can get the Username in _Layout.cshtml page by using @User.Identity.Name I added new field to the table AspNetUsers called FullName but I cant't display it in _Layout.cshtml, It's show just Name! How can I get FullName in...
more »

2017-10-28 18:10 (3) Answers

Accessing nested JSON elements in MVC and Razor

I'm very new to MVC, JSON, Razor and indeed .Net - so go easy on me. I have been working through the CosmosDB demo from Microsoft with no problems. I then started using the code as a base to retrieve nested JSON elements into a HTML table. I have m...
more »

2017-10-28 11:10 (1) Answers

How to create array from Model?

Im new to javascript and I have this code where I should pass or convert to jQuery. I have tried some code but it doesn't work. How can I do it properly? Here is what it should look like: <script> $('#calendar').fullCalendar({ defaultDa...
more »

2017-10-24 10:10 (2) Answers

VS2017: Why razor project still refers to MVC?

I'm very confused about MVC and razor projects for ASP.NET Core 2.0. In Visual Studio 2017 I do the following: New project Web ASP.NET Core Application (C#) Web Application (NOT Web Application MVC) But when I open the cs code of a page I see: u...
more »

2017-10-22 09:10 (1) Answers

ASP.NET Core 2.0 read: Options in razor page

Following this guide, I'm trying to show on an ASP.NET Core 2.0 page the settings values. In startup.cs I added some services: services.AddLocalization(options => options.ResourcesPath = "Resources"); services.AddOptions(); services.Configure<...
more »

2017-10-21 21:10 (2) Answers

Gets Data in Json Format From AngularJs Controller

I am having a hard time with AngularJs. It works accordingly in some cases for me and when I try to change the template of the project, it doesn't work anymore. Here is the scenario - I have a controller in ASP.NET MVC that returns the list of produc...
more »

2017-10-21 09:10 (0) Answers

Razor view finding ViewModel without full path

Still new to ASP.NET, so forgive me for the simplicity of my question. I'm writing a demo app in ASP.NET MVC Core 2. For my Views, I'm referencing the full path to the ViewModel, for example: @model MyApp.ViewModels.ProductDetailViewModel A sol...
more »

2017-10-18 19:10 (1) Answers

Unable to Open Model Popup using ActionLink

I have this code and I am trying to open a Model Popup @Html.ActionLink("Edit ", "My_Action", "My_Controller", new { Tag_List = Item._tags }, new { @class = "btn-link glyphicon glyphicon-tags", @data_target = "#tagsmodal" }) <div id="tagsmodal" ...
more »

2017-10-16 13:10 (1) Answers

Currency format without symbol

A Razor page has to show two different currencies together, that is: formatting the numbers with periods and commas but without the symbol. Thus, instead of: R$ 3,000.00      US$ 9,000.00 There would only be: 3,000.00...
more »

2017-10-14 22:10 (1) Answers

Navigate to Url or Url.Action in Javascript

This may have already been answered somewhere but I cannot find any information that makes sense to me. I have a Cancel button in my cshtml that contains a href='@Url.Action("Index"). It looks like this: <a href='@Url.Action("Index")' class="...
more »

2017-10-13 00:10 (1) Answers

Css updating on right click only

I am facing a problem with my css updating when i right click, i have not clue why this is happening as no code is indicating it to change. When i click my mega navigation in mobile mode, it opens up weirdly, but when i right click it opens how it sh...
more »

2017-10-10 13:10 (0) Answers

Equivalent Server.MapPath for http query

I have an .net Mvc application started with http://localhost:1234. In production the url is http://mywebsite/mysubfolder. In a HelperExtension i have a method rendering image path like : public static MvcHtmlString DisplayPicture(this HtmlHelper ht...
more »

2017-10-09 17:10 (1) Answers

Single .NET Core Razor C# functions in all Views

I know there is a way to ad c# functions inside a view and call them by using @functions{ ... } method inside my view, but is there a way to create a shared view with those functions to include inside of the controllers view without copying the same ...
more »

2017-10-06 12:10 (2) Answers

Hide Bundles content from external viewing in MVC3

I have registered bundles in Global.asax.cs file. When I enter my domain name with bundles path in browser, I am able to view minified js,css content in browser. How to hide contents from external viewing which are added in bundles. Below URL should...
more »

2017-09-26 09:09 (2) Answers

Razor - Apply random CSS class from array

I have searched everywhere for an answer to this, to no avail. If already answered somewhere else, then my apologies. Here is my current code: @{ foreach (var item in Model.Activities) { <div class="col-md-4 col-lg-4 c...
more »

2017-09-25 20:09 (1) Answers