Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have update panel and inside update panel common div for all the code.I want to hide and show div from client side javascript but getting an error

Failed to load resource: net::ERR_CACHE_MISS

on error page click error shows in the below code

XML
<script>(function() {with (this[2]) {with (this[1]) {with (this[0]) {return function(event) {javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContent$ViewPatient$btnViewPatient", "", true, "", "", false, false))
};}}}})</script>


below is java script called function that is called from code behind method

C#
<script type="text/javascript">
    var $ = jQuery.noConflict();
    function SetPatientVisibleTrue(obj) {
        debugger;
        $('#MainContent_AddPatient_DvPatient').show();
        $('#<%=successmessage.ClientID%>').hide();

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {

            debugger;
            $('#MainContent_AddPatient_DvPatient').show();
            $('#<%=successmessage.ClientID%>').hide(); 
        }

    };
</script>
Posted
Updated 21-Feb-18 1:18am
Comments
Hardeep Saggi 16-Mar-15 8:47am    
what am i guessing you are using chrome!! Right?
vinodkumarnie 14-Aug-15 7:20am    
Can you share your HTML too?

Use the property visibility:
http://www.w3schools.com/jsref/prop_style_visibility.asp[^].

—SA
 
Share this answer
 
Recommend you use the style 'display', that always work

JavaScript
/* e.g. hide */
ctrl.style.add('display', 'none')

/* or show */
ctrl.style.add('display', 'block')
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900