Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I am developing a website in ASP.NET where I need to show a POPUP

on HOVER on Linkbutton which is Placed inside the GRIDVIEW control .

The the POPUP should display the chart with Values that we fetch from Database.

Every Time user hover the Linkbuttons he/she should be able to different chart in

POPUP and on mouseout the popup should close.

Can you suggest a best way to do this.I tried to Call Javascript Window.OPen and it works fine But I need to display the POPUP in more nice format .

Your advice is important to me.

Have a good day ahead,

Regards,
Kishor
Posted

1 solution

I would suggest you to use the jQuery UI Dialog. The jQuery Dialog has a rich UI and it can be customizable. You can display the jQuery Dialog on hover of the link button and load the content of the dialog through ajax.

Bind hover events on link button:
C#
private void OnItemDataBound(object sender, 
        System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == Listitemtype.Item || e.Item.ItemType == Listitemtype.AlternateItem ) 
{
        LinkButton Img = (LinkButton)e.item.FindControl("lnkButton");
       lnkButton.Attributes.Add("onmouseover","OpenDialog");
       lnkButton.Attributes.Add("onmouseout","CloseDialog");

 }

}


Javascript methods:
JavaScript
function OpenDialog() {
$(".chartPanel").dialog({  //Ensure you have a div element with class as chartPanel 
    autoOpen: false,
    open: function() {
        //Your ajax call here to load the chart
    }
});
}

function CloseDialog()
{
$(".chartPanel").dialog("close");
}


You can refer the link below of loading the content inside jQuery Dialog through Ajax.

http://www.christopherchin.com/blog/index.cfm/2009/3/19/jQuery--ajax-dialog--load-external-content[^]
 
Share this answer
 
v2

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