Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Greybox popup not show properly after postback

$
0
0
when the page loads first time, the links work as they should, opening in a Greybox popup(In the Academic Calendar).
 
Domain Name- http://cpsmau.com/
 

However, if I do a partial postback (go to september month) , the AJS Greybox functionality is lost and clicking on the link it show on other page not on graybox popup.
 
Can any one help me?

How do we re-initialize the AJS object on every asynchronous postback.

string script = @"window.addEvent('domready', function() { new AJS(); })";

ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), System.Guid.NewGuid().ToString(), script, true);

This script is not working.
 
My page code is.........
 
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
      {
            DataTable dt = command.ExecuteQuery("SELECT sys_id,date, value,value3 FROM com WHERE branchCode=" + ddlSchool.SelectedValue);
            if (dt.Rows.Count > 0)
            {
                  for (int i = 0; i < dt.Rows.Count; i++)
                  {
                        if (e.Day.Date.CompareTo(Convert.ToDateTime(dt.Rows[i]["date"].ToString())) == 0)
                        {
                              if (dt.Rows[i]["value3"].ToString() == "Holiday")
                                    e.Cell.BackColor = System.Drawing.Color.DarkRed;
                              else
                                    e.Cell.BackColor = System.Drawing.Color.Green;
                              e.Cell.ForeColor = System.Drawing.Color.LightYellow;
 
                              e.Cell.Controls.Clear();
                              e.Cell.Controls.Add(new LiteralControl("<a id='A1' href='../Common/HolidayAndEventsDetail.aspx?id=" + dt.Rows[i]["sys_id"].ToString() + "', onclick='return window.open(this.href, this.target);' rel='gb_page_center[500,400]' target='_blank' style='display:block;color:white;'>" + e.Day.DayNumberText + "</a>"));
                              e.Cell.ToolTip = dt.Rows[i]["value"].ToString();
                        }
                  }
            }
      }

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>