Saturday 15 March 2014

How to remove the .aspx from ASP.NET url's ? How to cut the URL's in short form

Solution:-


Just put this piece of code in the Web Config file and be happy !!!!!!

<system.webServer>
    <rewrite>
        <rules>
            <rule name="RewriteASPX">
                <match url="(.*)" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="{R:1}.aspx" />
            </rule>
        </rules>
    </rewrite>
  </system.webServer>


And just the page name in the link as it is for Example see this:-

<a href="Index.aspx">Sign in</a>  1.Don't use this

<a href="Index">Sign in</a>  1.Use  this

Thanks ..:)

The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

Problem in Web Config File :-

The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

Solution:-

Put this piece of code in the Configuration file and it will be solved..

 <compilation debug="false">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
           </assemblies>
        </compilation>