Posts

Showing posts with the label MVC

Create your own Short URLs

URLs for deeply nested pages can be difficult to read and even harder to remember, especially for new visitors to a website. When giving a presentation or participating in a technical conference, website owners tend to put shortened URLs on their slides so that the audience can write down the link on a piece of paper or navigate on their phone. Many URL shortening sites have caught on and you can find many examples with a quick search. But, these URLs are most often a string of random characters that do not have much meaning. What if we wanted them to be more memorable? Creating Your own Short URLs Lets say you have the following URL which is for a page that has information about the event at which you are presenting. www.mywebsite.com/events/northamerica/2017/july/exampleconference    As you can see from the structure of the URL, the page for this conference is nested within some hierarchy that is related to the organization of the site. Yet, this URL may be difficult...

IIS Express Client Certificates

We recently had to investigate how to  CAC -enable a web application, one of the challenges was setting up a proper development environment to prototype & test code changes before deploying to other environments. STEP 1  - You need to have a client certificate installed on your development machine. Assuming you don't have a readily available CAC or Smart Card, you can either  create a self-signed certificate  OR for this example we just used a  corporate outlook email client certificate (used to sign & encrypt emails).   Note : The certificate should be available in your web browser. For IE go to  Internet Options > Content > Certificates  to view all your certificates. In Chrome, go to  Settings > Show advanced settings > HTTPS/SSL > Manage certificates . STEP 2  - Using Visual Studio, create a default ASP.NET MVC 5 web application. STEP 3  - Enable SSL for your project. In Visual Studio, hit  F4...

Upgrade to ASP.NET Identity

For our first post, we'll dive into some technical challenges we encountered when upgrading our Authentication. Our site was using a custom Forms Authentication implementation before Microsoft released ASP.NET Identity 2.0. Since we recently upgraded our solution to MVC 5, we took the next step of upgrading the authentication components and benefit from the simplified 3rd party integration. If you happen to face a similar situation, use the steps below as a guideline to help you complete the upgrade .  Hope this helps! Assumptions You're using Forms Authentication with ASP.NET You've upgraded your web solution to ASP.NET MVC5+ You have a custom USER table with an Id of type integer Outline Database Add new columns to the USER table Add new tables Update EDMX or Code-First POCO for USER table only Packages Add nuget packages to your solution Configuration Add a NEW database connection string to Web.Config Remove Forms Authentication & Memb...