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

XML response processing

I am getting raw XML response from eBay API call. Now I have to grab values from XML and add those values to ViewModel object then return data to my View. I have already tried few things bellow but I am unable to grab XML response items and assign to...
more »

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

Access class from GUID

I'm using Entity Framework Code First and ran into a slight problem. I have two tables as such: User +--------+-----------+ | id | name | +--------+-----------+ | def789 | Bob Smith | +--------+-----------+ Actions +--------+-------------...
more »

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

ASP.NET MVC - Get Id from a dropdownlist

I'm new in ASP.NET MVC and i have a problem. I needed to get a string "Category" from a dropdownlist, that was my code: var CList = new List<string>(); StreetFooder sf = db.StreetFooders.Single(s => s.User.UserName == this.User.Identity.Na...
more »

2017-10-13 12:10 (3) Answers

Bundling and minification ASP.NET

I have a huge web application that bundles and minifies a huge amount of javascript and css files. When we release a new version, we notice that at the first request of each page (controller + view) the software takes a lot of time to respond. So, I...
more »

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

Secure flag for ASPXAUTH Cookie in MVC

We have an Application which is developed using ASP.NET MVC3. Penetration-test done by an IBM AppScan tool. Issue has been reported and it was ASPXAUTH is not secure. When I checked on the browser's developer tools, there are some cookies with Sec...
more »

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

Update google heatmap

I have asp.net project I have google heatmap in View and need to update it Here is script code on client side. @section scripts { <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCea6mL2cqwVid2ESIjuJ0C31RbNVQN...
more »

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

Get data from ajax to mvc action

I want to send array of objects from ajax call to controller action. On back-end side I have container classes: public class MyContainer { public string Id { get; set; } public Filter[] Filters { get; set; } } public class Filter { pu...
more »

2017-10-13 08:10 (2) 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

.NET Core 2.0 - BlogCategory from BlogItem

Just trying to get my @item.BlogCategories.CategoryName to display the Category, but it says the object is not set. I checked the DB. and the BlogCategoryId is correct. If this was MVC5 it wouldn't be a problem. whats different in MVC core? it write...
more »

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

Image next to text in ASP.NET View

I would like to display some text next to an Image I have, however no matter how I change the css it does not seem to respond. In de css file I tried changing "p.StoryLineText" to Just StoryLineText, to just p, I tried p .StoryLine text. Am I missing...
more »

2017-10-12 15:10 (1) Answers

Session variable returning null

I have a login page and I tried storing some data in my sessions but when I run the project it gives me this error as you see in screenshots: I tried to debug my code as you see in screenshot and its show me Both No_ and E_mail is null even though I...
more »

2017-10-12 15:10 (1) Answers

Why does my list return only last row?

I am using a list and filling it from the database. public List<HimHer.Models.Stories> GetAllImages() { try { using (SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConStr"].Co...
more »

2017-10-12 13:10 (3) Answers

How to insert a line break after every dot in c#?

In one of my web pages, I am retrieving the data from a back end SQL server database. That data sometimes contain multiple paragraphs without any line break. I want that it should insert a line break automatically after every dots. How is it poss...
more »

2017-10-12 12:10 (1) Answers

C# MVC Localization Issue with Image URLs

I need to build a c# MVC portal that is localized. I have the following route defined: routes.MapRoute( name: "DefaultLocalized", url: "{lang}/{controller}/{action}/{id}", constraints: new { lang = @"(\w{2})|(\w{2}-\w{2})" }, // en or en-US ...
more »

2017-10-11 17:10 (2) Answers

How to read a custom header in Swashbuckle?

I used the following code to add a custom header to an operation: public class RequestIdParameter : IOperationFilter { public void Apply(Swashbuckle.Swagger.Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) {...
more »

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

MVC Binding List of Objects in Object

I'm trying to dynamically build a table that needs to be bound to a ViewModel on form submission. First item is the Action the form is submitting to. Then the Parent ViewModel and then the child ViewModel. Below those are two text fields represent...
more »

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

Get file name instead of controller name

I use this line of code for error handling: catch (Exception exception) { string controllerAction = $@"{ControllerContext.RouteData.Values["controller"].ToString()}Controller/{ControllerContext.RouteData.Values["action"].ToString()}"; ...
more »

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

Error: redirect_uri_mismatch (ASP.NET MVC)

I am getting the following error when trying to let user login using GOOGLE I have tried so many things and nothing works I used the following code initially app.UseGoogleAuthentication(clientId: "APIKEY.apps.googleusercontent.com", ...
more »

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

How can I call global.asax on .asp page open

Hi on redirecting of catalogsmain.asp I want to call Global.asax file and in that I want to call Application_BeginRequest method. Actual I have one old website which is created in old ASP so it contains all page with extension .asp. Now we had creat...
more »

2017-10-09 19:10 (1) 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

Protected Variables and model binding

Please see the models below: public class Apple //: Fruit { public string Description { get; set; } public int Id { get; protected set; } } public class AppleModel { public int Id { get; set; } publi...
more »

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