Gaurav Taneja

Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

  Home  |   Contact  |   Syndication    |   Login
  90 Posts | 0 Stories | 81 Comments | 7 Trackbacks

News




Google RankGoogle PR™ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.

Archives

Post Categories

Image Galleries

Atlas

Error

OutLook

SharePointService

Usefull Site Links

Wednesday, April 16, 2008 #

Javascript

<script language="javascript" type="text/javascript">
 function ConfirmDelete()
    {
        if(confirm("Do you really want to Delete the Abused Record?")==true)
        {  
            return true;
        }    
        document.getElementById('<%=lblMsg.ClientID%>').innerHTML="";
        return false;       
    }
   
    function ClearMessageLabel()
{
      var msg=document.getElementById('<%=lblMsg.ClientID%>');
     
      if(msg!=null)
      {
        msg.innerHTML="";
      }
}

   </script>

Cs code

btnDelete.Attributes.Add("onClick", "javascript:return ConfirmDelete('" + CommonFunction.GetErrorMessage("ERR1046") + "');");


Well while implementing Ajax i had received error due to Sys.WebForms.PageRequestManagerParserErrorException

the best solution that i could figure out to over come is catch this exception and byPass it.. if any body has a good way of catching this exception why this arise Please do let me know.

i has to modify the script

<script type="text/javascript">
                                        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args)
                                        {
                                          
                                             if (args.get_error()!=null)
                                             {
                                                                                        
                                                 if (args.get_error().name === 'Sys.WebForms.PageRequestManagerParserErrorException')
                                                 {
                                                   
                                                    // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself
                                                    args.set_errorHandled(true);
                                                     window.location.href='Login.aspx?Message=SessionExpired';
                                                }                                                
                                                 if ( args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException')
                                                {
                                                  
                                                    // remember to set errorHandled = true to keep from getting a popup from the AJAX library itself
                                                    args.set_errorHandled(true);
                                                    window.location.href='Login.aspx?Message=SessionExpired';
                                                }
                                             
                                             }
                                         }
                                         );
                                     </script>


Javascript

<script language="javascript" type="text/javascript"  >
function openPopUp(sPicURL)
{
     var win=window.open(sPicURL, "","menubar=no,scrollbar=yes,resizable=no,width=700,height=600");
     return false;
}
function openImagePopUp(sPicURL)
{
     window.open("../common/contentImagePopup.htm?"+sPicURL, "","width=250px,height=180px,top=360px,left=180px,resizable=no,menubar=no");
}

</script>


Cs code

  imgPhoto.Attributes.Add("onclick", "javascript:openImagePopUp('" + strPath + "');");