Quantcast
Channel: ASP.NET Core
Browsing all 9386 articles
Browse latest View live

Get doc file without automatic downloading browser

Hi folks,I am using Aps.net core. Here is my sample code:public FileStreamResult DownloadPoliceReport([FromRoute] int id) { var getFile = _context........; MemoryStream ms = new...

View Article


Web API project layout best practice

Its been a while for me since I have developed with asp.net, I have a requirement to create a web api which will aggregate and reformat a myriad of other web services we use internally. What is the...

View Article


Controlling Raspberry Pi 3 GPIO from .NET Core 2.0 app

Hi, I'm working on a school project and I just got confused with all the technology out there.The project consists (at least that's what I imagine at the moment) of: Hardware part - Raspberry Pi 3...

View Article

Image may be NSFW.
Clik here to view.

Select Expression using LINQ

I m trying to select and return certain columns form a table using the following code, instead of returning the columns that I select the query returns the whole table, what am I doing wrong? [HttpGet]...

View Article

I am lost in indentity

Hi all i am new to asp.net core så i need some help list my users til a list on a view, but i also need a way for my admin to edit the users and sending them a new password and so on. How do i do...

View Article


Mock session for integration test

How can I make session mock in integration test? Here is example test method [TestMethod] public void Mvc_GetBlogsShouldBeOk() { // I need this SessionMock.GetString("filter.name").Returns("David");...

View Article

Running into issues after attempting to migrate my .NET Core 1.1 app to 2.0

I am running into issues after attempting to migrate my .NET Core 1.1 app to 2.0, as I was following this tutorial. I also looked at this tutorial. I installed .NET Core 2.0, and I updated my Visual...

View Article

Can't keep application alive

Hello,I am using Ubuntu 16.04 and I want to run my .NET Core web api. I can do that by using dotnet "Smity API.dll" &But whenever I close Putty, I get 502 Bad Gateway when I can my web api. Before...

View Article


ASP .Net Core 1.1. Web API stopped working after upgrading to .Net Core 2.0

I have a Web API which worked perfectly in .Net Core 1.1 but has stopped working in .Net 2.0. The problem appears to be related to authentication, because I only get it when I try to access endpoints...

View Article


AspNetCore.Cookies Forced Logout

Hi,We're using AspNetCore.Cookies for authentication.We've noticed that every time we've restarted the IIS server, it forces all of the users to re login, even though the cookie is still there and...

View Article

Image may be NSFW.
Clik here to view.

Display all images from database

Hi folks, Here is my code as below:[HttpGet("Download/{id}")] public FileStreamResult ([FromRoute] int id) { var getFile = _context.UploadPoliceReports.FirstOrDefault(m => m.UserVehicleID == id);...

View Article

When to use Razorpages?

In 2.0 a new feature is Razorpages.But what is the benefit of using this? Will my pages be served faster? What could be an example on a situation this new feature has benefits over serving the page...

View Article

VS2015 Tests no longer show in test explorer

I am currently developing in VS2015 (VS2017 not an option currently).I have been successfully using VS2015, MSTest & test explorer for many months. Just recently the tests have stopped showing in...

View Article


Date Format in Core

Hi,Why is the date formatting in a 24-hour format is not working in Core?//myUTCDate = 2017-06-29 10:54:34.4880001 <<--from db TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById('AUS Eastern...

View Article

After upgrate to Net Core 2.0 Localization in View (Inject) is not Working

Hello,After upgrate to Net Core 2.0 Localization in View is not Working, but In Controller works .I tried to create a default project in Net Core 2.0 and is not working too .ConfigureServices-...

View Article


asp.net mvc core 1.1.2 google oauth2 configuration domain cannot be found

I am using google authentication in asp.net mvc 1.1.2 in vs 2015. i set it up following the documentation and successfully set it up. running with minor glitches in localhost. my site finally was...

View Article

Load View programmatic in controller action

Hi!I want to load and process a View programmatic from a controller and read the generated html as a string.Something like: string html = FunctionToLoadView("MyViewName.cshtml"); Is this possible??

View Article


Models from Portable Class Libraries

How do I reference a Portable Class Library as a model in creating a view.   I have all of my models in this library to work with a Windows universal app created in Visual Studio 2015 and now I am...

View Article

Should I use List or IEnumerable

Hi!In ASP.NET Core and Entity Framework Core, should I use List<T>or IEnumerable<T>?Whats the main difference?

View Article

Hungarian notation in System Generated code

While Microsoft suggests to avoid using Hungarian notations in code, why do the system generated code of Event Handler contains following line? private void TextBox1_TextChanged(object sender,...

View Article
Browsing all 9386 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>