Click here to Skip to main content
16,017,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,
I am using sexy lightbox to show some information by clicking on View link
in the gridview.
the light box code is in Jquery(sexylightbox.v2.2.mootools.js)
It works proper when there is no update panel.

Now i want to use Updatepanel in my page. First time the light box
opens properly. but when i click on sorting or searching light box is not opening and gives some error.
I mean sexy light box is not working after the postback. Please can anybody solve my problem or any alternate light box is also welcomed.

Thanks in advance
Posted
Comments
Sunasara Imdadhusen 10-Feb-11 1:59am    
What is error?
krishnaMurali 11-Feb-11 2:05am    
the error is:
System.FormatException: Input string was not in a correct format.
if (Request.QueryString["Id"] != null)
{
id = Convert.ToInt32(Request.QueryString["Id"]);

Try This..
add after script manager its working.....

XML
<script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
        function EndRequest(sender, args) {
            Lightbox.initialize()
        }
</script>
 
Share this answer
 
Are you using code like this somewhere in a JS file?

$(document).ready(function(){
    SexyLightbox.initialize();
  });


If yes, this will not work with update panel.

Try the following code in Page_Load event.

C#
string script = "$(document).ready(function(){ $(function() { SexyLightbox.initialize();";
        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "InitializeScript", script, true);
 
Share this answer
 
Comments
krishnaMurali 11-Feb-11 2:01am    
thanks for fast reply,
yes, i had the above code in .aspx page, i removed it and added your suggested code
but i face same problem.

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