Posts

Showing posts from February, 2012

IIS Adding MIME Type

If you want to access some file xyz.vin.001  through web server and it is giving the 404 error

404 - File or directory not found.The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
 then must configure the MIME Type as follows


Open Internet Information Services (IIS) Manager:
If you are using Windows Server 2008 or Windows Server 2008 R2:
On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
If you are using Windows Vista or Windows 7:
On the taskbar, click Start, and then click Control Panel.
Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
In the Connections pane, go to the site, application, or directory for which you want to add a MIME type.
In the Home pane, double-click MIME Types.

In the MIME Types pane, click Add... in the Actions pane.
In the Add MIME Type dialog box, add the file name extension and M…

Modalpopup not showing in Chrome from javascript function

I am having a modalpopup extender in my aspx page. It is working fine in mozilla and IE but Modalpopup not showing in Chrome from javascript function.

1. Calling javascript function from html link

<a href=javascript:vinModal('BEST','%'); > Best Practices/Results </a> 

2. the function which call codebehind


<script type="text/javascript" >
    function vinModal( i, j )
        {

     document.getElementById('<%=HiddenField1.ClientID %>').value = j;
     document.getElementById('<%=HiddenField2.ClientID %>').value = i;
/*  document.getElementById('<%=lblPop.ClientID%>').innerHTML = "vinod";
       $find('ModalPopupExtender1').show();
     document.getElementById('<%=LinkButton1.ClientID%>').click();   // this line doesnt work in chrome*/
       __doPostBack('LinkButton1','hi');
    }
</script>

3. The codebehind function which activate modalpopupextender.


Remove special character/Nonnatural character from string/filename

Remove special character/Nonnatural character from string/filename

it's useful to have filename without special characters...


Public Shared Function strip(ByVal str As String) As String
               Return Regex.Replace(str, "[\[\]\\\^\$\|\?\*\+\(\)\{\}%,;>
    End Function
' Put \ with your character. to include dot use \.


another old method



Public Shared Function strip(ByVal str As String) As String
         remove nonnatural characters
        Dim intCounter As Integer
        Dim arrSpecialChar() As String = {",", "<", ">", ":", "?", """", "/", "{", "[", "}", "]", "`", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "-", "+", "=", "|", " ", "\"}


 …

Konami Code for Floating or Dancing Images in Webpage

In continuation to my last post... here is js file to have Konami Code for Floating or Dancing Images in Webpage.
Konami code triggers the  piece of JavaScript pulls off all the images from any web page and rotates or float’s them in a circular order.
Just copy the below code in a js file and give a reference to it in you webpage.

 <!-- Konami Code -->

    <script src="konamicode.js" type="text/javascript"></script>



js file

function onKonamiCode(fn) {
    var codes = (function(){
            var c = [38,38,40,40,37,39,37,39,66,65];
            onKonamiCode.requireEnterKey && c.push(13);
            return c;
        })(),
        expecting = function(){
            expecting.codes = expecting.codes || Array.apply({}, codes);
            expecting.reset = function() { expecting.codes = null; };
            return expecting.codes;
        },
        handler = function(e) {
            if (expecting()[0] == (e||window.event).keyCode) {
                expec…

Google+ Followers