Wednesday, July 16, 2014

Bootstrap 3 responsive not working on mobile

I was working on one eCommerce system and it was bootstrapped ... But somehow It was not working as responsive in mobile browsers but it was showing responsive nature in normal browser...

I was missing following line in header section

<meta name="viewport" content="width=device-width, 
initial-scale=1, maximum-scale=1">
 
 
And now it started working 
Submit this story to DotNetKicks

Read more...

Friday, April 4, 2014

301 redirect using web.config

To do 301 permanent redirect add following line of codes in web.config.


<configuration>
<system .webserver>
 <rewrite>
      <rules>
        <rule name="Redirect domain.com to www" patternsyntax="Wildcard" stopprocessing="true">
          <match url="*">
          <conditions>
            <add input="{HTTP_HOST}" pattern="yourdomain.com">
          </add></conditions>
          <action type="Redirect" url="http://www.yourdomain.com/{R:0}">
        </action></match></rule>
      </rules>
    </rewrite>
</system .webserver>
</configuration>
Submit this story to DotNetKicks

Read more...

Saturday, January 18, 2014

How do I enable HTTP PUT and DELETE for ASP.NET MVC

  1. GO to Handler Mappings in your IIS Manager
  2. Find ExtensionlessUrlHandler-Integrated-4.0
  3. double click it. 
  4. Click Request Restrictions... button and on Verbs tab, add both DELETE and PUT


Remove WebDav from "Modules" and from "Handler Mappings"


Modules:
                WebDAVModule, %windir%\System32\inetsrv\webdav.dll, Native, Inherited

Handler Mappings:

                WebDAV, *, Enabled, Unspecified, WebDAVModule, Inherited

Then Restart IIS

It results in a Web.Config change of:

  <system.webServer>
        <modules>
            <remove name="WebDAVModule" />
        </modules>
        <handlers>
            <remove name="WebDAV" />
        </handlers>
  </system.webServer>

 
Submit this story to DotNetKicks

Read more...