0
votes

I am new to web pages.

I made a ASP.Net website(Razor) but here WebSecurity uses cookies and I didn't wanted to use inbuilt features..

Hence I made a new ASP.NET Empty WebSite and then added a Layout page & a content page..

Now when I browse it with in the browser it shows extension .cshtml... This is not the case when I made a ASP.NET website(Razor), they show no extension.

My Question:

  1. Is there a way I can hide .cshtml extension or show .html instead.?
  2. Can I edit WebSecurity default methods like it saves userId in cookies I want to save it in Session..?
1
Please only post one question at a time. The heading and info is mostly about #1, so remove #2 from this question and post it as a new one. - Anders Abel

1 Answers

2
votes

Make sure any internal links in your application do not include the file extension. Then the extension will not appear in the browser address bar. If you right-click on an individual file in the File Explorer within WebMatrix and choose "Launch in browser", the extension will be shown, but that shouldn't matter.

If you want to know more about the standard routing behaviour in the Web Pages framework, I wrote an article about it here: http://www.mikesdotnetting.com/Article/165/WebMatrix-URLs-UrlData-and-Routing-for-SEO