ASP.NET MVC video caching

In an ASP.NET MVC application I'm playing a video in a loop using this code: <video id="video" name="media" class="container" preload="auto" autoplay loop controls> <source src="@Model.VideoFilename" type="video/mp4"> Y...
more »

2017-02-14 12:02 (0) Answers

Task.Run vs null SynchronizationContext

In an ASP.NET 4.5 application, which of these is better for calling an async method from a sync method? var result = Task.Run(() => SomethingAsync()).GetAwaiter().GetResult(); // or var temp = SynchronizationContext.Current; try { Synchron...
more »

2017-02-14 11:02 (0) Answers

Dapper and user defined database types

Let's say I have a user defined data type in the database: MySuperType which as two bigint properties in it (Id + Code) And I have a stored procedure which takes in those parameters: @MySuperType, @Price, @dateModified, etc... Now in my code, I ...
more »

2017-02-14 09:02 (1) Answers

Token based auth for aspnet-core web api

Dears, I've followed to authenticate the user for my web apis I managed to create a successful access-token when calling api/token My problem is the use of [Authorize], authorize filter...
more »

2017-02-13 17:02 (2) Answers

Check Website is TLS or SSL and its version

We have a website hosted in our server. How can we check the protocol of that website. I mean I need to identify the website is TLS or SSL. My requirement is that , First I need to check the TLS/SSL version of that my wesbite and then I need to modif...
more »

2017-02-13 11:02 (1) Answers

ASP.Net Core Sqlite in Azure

I have a ASP.NET Core Web Application using a SQlite database. This works perfect, but now I want to host it in azure. Where should i put my *.db file? I suppose the wwwroot folder is not the best place as it can be browsable! There used to be the A...
more »

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

Remove extra lines ASP.Net

everybody there's something weird in my webpage as it automatically adds new line after each controller <asp:Label ID="ll" Class="question_bold" runat="server" Text="label 1" Visible="false"></asp:Label> <asp:RequiredFieldVali...
more »

2017-02-12 17:02 (2) Answers

How to access asp controls in a class file

I have created a panel in my page view (tour.aspx file). Now I want to access it in my class file (add_tour.cs file). This is my panel: <asp:Panel ID="itinerary_panel" runat="server"></asp:Panel> This is my code behind tour.aspx file:...
more »

2017-02-12 15:02 (2) Answers

Many to Many Code first Insert New Record

i have 3 table Ads AdsCategory AdsAdsCategory when i try add new Ads, new Ads insert into Ads table and new AdsAdsCategory insert into AdsAdsCategory, but a new recored insert into AdsCategory how i can solve this problem public class Ads {...
more »

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

Transfer Session data from one form to another

I am working on a project for school in Visual Studio 2015. I have two pages, both have a last name text box. I need to transfer the lastname on form 1 to the last name textbox on form 2. Here is what i have: FORM 1: Under the button on click eve...
more »

2017-02-12 03:02 (3) Answers

Angular 2 Visual Studio Setup Problems

I followed the Angular2 VS setup from this page- The issue is that http://localhost:56428/ gives a 403 (forbidden) error, and the only way to access my index is to navigate to http:...
more »

2017-02-11 17:02 (3) Answers

Is this approach safe to use?

I'm fairly new to working with SQL Server and ASP.NET so I'm worried about SQL injection or other threats. I have a FormView referencing a SqlDataSource where the FormView has code-behind logic preventing unauthorized users from making changes to the...
more »

2017-02-11 17:02 (1) Answers

IIS, Updating Site, restart AppPool and Site?

Each time I make an update to one of my sites, I go into the IIS Manager and I first recycle the App Pool for that site, then restart the site itself. Is this really required? I restart the AppPool to make sure the new bins are compiled and running...
more »

2017-02-11 13:02 (0) Answers

Response GZIP Compression not working .net

I need to compress json response, I have tried IIS dynamic compression and used below code to compress but compression is not working it always Content-Type:application/json; charset=utf-8, Gzip headers are properly send to server. I have tried the c...
more »

2017-02-11 08:02 (0) Answers

Connect Xamarin client to SignalR server

Before you start looking for duplicates, please read till the end. I have two project in virtual machine: ASP.NET Web Application, hosting SignalR server. Exactly this tutorial project. Simple Xamarin.Android project, running on Intel emulator us...
more »

2017-02-11 05:02 (0) Answers

Allow string ID with ASP.NET MVC route

I have the 2 following routes setup and they are working fine when a valid request is sent. config.Routes.MapHttpRoute("DefaultApiWithId", "{controller}/{id}", new { id = RouteParameter.Optional }, new { id = @"\d+" }); config.Routes.MapHttpRoute("D...
more »

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

Switching Between VS Code and VS 2015

I am a single developer starting out on an ASP.Net Core MVC project with Angular 2. I used the Steve Sanderson template VS Angular 2 Template which works well in Visual Studio 2015. Up until now I have been developing the structure, and my understand...
more »

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