How do I execute javascript from code behind where the button inside an updatepanel
I want to open a div inside a fancybox and I am opening it from code behind and It is working but I want to put the button inside an updatepanel but after that the javascript is not triggering maybe because I am putting it inside document.ready what else we can put the trigger in to work
html
<a id="various" runat="server" href="#inline" style="visibility: hidden"></a>
<asp:Literal ID="fancyLtr" runat="server"></asp:Literal>
<asp:UpdatePanel ID="UpdatePanel6" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
javascript
$(document).ready(function () {
$("#ContentPlaceHolder1_various").fancybox();
});
code behind
protected void Button1_Click(object sender, EventArgs e)
{
various.Attributes["href"] = "#inline";
fancyLtr.Text = "<script>jQuery(document).ready(function() {$(\"#ContentPlaceHolder1_various\").trigger('click');});</script>";
}
Thanks in advanced