What is ASP.NET Identity’s IUserSecurityStampStore interface?

Looking at ASP.NET Identity (new membership implementation in ASP.NET), I came across this interface when implementing my own UserStore: //Microsoft.AspNet.Identity.Core.dll namespace Microsoft.AspNet.Identity { public interface IUserSecurityStampStore<TUser> : { // Methods Task<string> GetSecurityStampAsync(TUser user); Task SetSecurityStampAsync(TUser user, string stamp); } } IUserSecurityStampStore is implemented by the default EntityFramework.UserStore<TUser> which essentially get and set the TUser.SecurityStamp property. … Read more

How to change the text of a label?

I have a radiobutton list and on click on the radio button item I have to change the text of its label. But for some reason it’s not working. Code is below: <asp:Label ID=”lblVessel” Text=”Vessel:” runat=”server”></asp:Label> <script language=”javascript”> $(document).ready(function() { $(‘#rblDiv input’).click(function() { var selected = $(“#rblDiv input:radio:checked”).val(); if (selected == “exportpack”) { $(‘#lblVessel’).text(“NewText”); } … Read more

Is Response.End() considered harmful?

This KB Article says that ASP.NET’s Response.End() aborts a thread. Reflector shows that it looks like this: public void End() { if (this._context.IsInCancellablePeriod) { InternalSecurityPermissions.ControlThread.Assert(); Thread.CurrentThread.Abort(new HttpApplication.CancelModuleException(false)); } else if (!this._flushing) { this.Flush(); this._ended = true; if (this._context.ApplicationInstance != null) { this._context.ApplicationInstance.CompleteRequest(); } } } This seems pretty harsh to me. As the KB article … Read more

ASP.NET web.config: configSource vs. file attributes

Within an web.config-file in an ASP.NET-application some sections of config, like appSettings and connectionStrings, supports the attributes file and configSource. What is the difference between using the file-attribute and the configSource-attribute? When should you use which attribute and can you use both? <?xml version=”1.0″?> <configuration> <appSettings file=”AppSettings.config”> </appSettings> <connectionStrings configSource=”ConnectionStrings.config”> </connectionStrings> <!– … –> </configuration> … Read more

How to find reason of failed Build without any error or warning

I have a WebApplication which contains reference to WCF services. While building using Visual Studio 2010, Build fails without any error or warning. However building the .csproj using MsBuild is successful. Can’t figure out what should I try in Visual Studio, to resolve / diagnose the issue. Can you please help out? EDIT: I find … Read more

Using different Web.config in development and production environment

I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment. The application reads settings from Web.config file via WebConfigurationManager.AppSettings property. I use Build/Publish command to deploy the application to production server via FTP and then manually replace remote Web.config … Read more

ASP.NET Identity DbContext confusion

A default MVC 5 App comes with this piece of code in IdentityModels.cs – this piece of code is for all the ASP.NET Identity operations for the default templates: public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext() : base(“DefaultConnection”) { } } If I scaffold a new controller using views with Entity Framework and create … Read more