Auto Ad Code

Showing posts with label not working. Show all posts
Showing posts with label not working. Show all posts

Friday, March 1, 2013

jQuery not working in UpdatePanel

If you are reading this then this means that you are facing the same problem which I faced and the problem is that jQuery functions are not working after any of the event occurred within the Updatepanel.

I mean suppose you are showing and hiding some DIV using jQuery .show() amd .hide(), the DIV resides in an updatepanel where you have another button as well which is a server side button and calls the Server side event using AJAX (update panel), after doing your work of this button you try to show/hide the DIV but you get surprised as the jQuery function is no more being called.

You jQuery code would be like this

<script type="text/javascript" language="javascript">
  $(document).ready(function () {
      $("#btnTest").click(function () {
       $("#dvTest").show(); //Here you could be having hide/toggle/slideToggle etc etc
    });
  });
</script>

Solution
So whats the solution? Solution is very easy and simple. Use your jQuery code as following
<script type="text/javascript" language="javascript">
  $(document).ready(function () {
     $('#btnTest').live('click', function () {
        $('#dvTest').show(); //Here you could be having hide/toggle/slideToggle etc etc
        return false;
     });
  });
</script>


Hope your issue is solved?

Happy coding :)

Tuesday, December 25, 2012

[RESOLVED] Show Hidden Files and Folders not working. Windows XP

Though the problem and solution is not at all related with ASP.Net but still is an irritating issue.

Okay here is the problem,
(Note that this issue is created normally due to some virus so I am supposing that you have scanned your system with some good Anti Virus with latest virus definitions)

You have to 'Show the hidden files and folders'.
1. You go to Tools -> Folder Options -> View Tab.
2. Then you check the "Show hidden files and folders" options and click Ok (or Apply then Ok).
Now hidden files and folders are supposed to be available but when you check they are still not there.
Frustrated? Yeah obviously. you repeat above two steps several times but each times either you see the option "Do not show hidden files and folders" checked in View Tab or no option checked even you have checked the "Show hidden files and folders" multiple times.
This is really frustrating I know. Anyways here are three methods you should follow in sequence. If you are good at luck the Solution 1 will serve you or then the Solution 2, and if you are not so good at luck then Solution 3 will surely work for you :). Note that even if  your problem get solved using Solution 3 then still you will be luck (no matter less).
All the best!

Solution 1:

1. Click Start -> Run
2. Type regedit and click Ok.
3. Find the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL
4. Look at the "CheckedValue" key in the pane at right  This should be a DWORD key. If it is not DWORD key then delete it.
5. If you have deleted the "CheckedValue" at step or "CheckedValue" was not present in right pane then Create a new key called "CheckedValue" as a DWORD with a value of 1 by right clicking in the right pane Else if "CheckedValue" was there with value other than 1 then double click "CheckedValue" and set the value 1.
6. The "DefaultValue" (its DWORD value as well) key should be having value 2 in right pane. If its not having value 2 or is not DWORD then delete and create with value 2 just like you created "CheckedValue" at step 5.
7. Find the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN
its the key adjacent of the key at step 3. 
8. Look the values of "CheckedValue" and "DefaultValue", both of these are DWORD and should be having value = 2. If not DWORD or having any value other than 2 then delete or update just like you did at step 5.
9. Close the Registry Editor and check the option "Show hidden files and folders". If its a success then Congratulations! and if its a fail then don't be panic and go to Solution 2.

Solution 2:

1. Click Start -> Run
2. Type regedit and click Ok.
3. Find the key: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
4. Check for the key "Hidden" (of type DWORD) in right pane. If its not a DWORD key then delete it.
5. If you have deleted the "Hidden" key or if it was not there then Create a new DWORD value type key by right clicking in Right Pane and set the value =1 else if it was there with any value other than 1 then set it to 1.
6. Close the Registry Editor and Check the "Show hidden files and folders" option.  If its a success then Congratulations! and if its a fail then don't be panic and go to Solution 2.

Solution 3:

1. Click Start -> Run
2. Type cmd and click Ok. This will open the Command Prompt (DOS)
3. Type regsvr32 /i browseui.dll then press the Enter key, wait for a confirmation window. (You can type this directly in RUN and can press enter and then can wait for t he confirmation window)
4. Type regsvr32 /i shell32.dll then press the Enter key, wait for a confirmation window. (You can type this directly in RUN and can press enter and then can wait for t he confirmation window)
5. All done. Now check the option "Show hidden files and folders" which should now be working.


If you have followed above steps carefully and your system is Virus free then you must have solved the problem. If problem still exists or you can not any step from above then please comment.

All the best.