On my .ASPX page I have:
When I click the IMageButtons I need the scriptmanager to execute a javascript function that is in the swfobject.js file. I can get this to happen on the Page_Load (below) but not on the button clicks. What do I need to do to fire off a javascript function on AJAX postbacks?
| <head id="Head1" runat="server"> |
| <title></title> |
| <script type="text/javascript" src="swfobject.js"></script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"> |
| <asp:ImageButton ID="btnPrev" runat="server" onclick="btnPrev_Click" ImageUrl="images/btnPrev.png"/> |
| <asp:ImageButton ID="btnNext" runat="server" onclick="btnNext_Click" ImageUrl="images/btnNext.png"/></td> |
| <div id="flashContent"> |
| </div> |
| </telerik:RadAjaxPanel> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"> |
| </telerik:RadAjaxLoadingPanel> |
When I click the IMageButtons I need the scriptmanager to execute a javascript function that is in the swfobject.js file. I can get this to happen on the Page_Load (below) but not on the button clicks. What do I need to do to fire off a javascript function on AJAX postbacks?
| sSWF += @"<script type=""text/javascript"">"; |
| sSWF += @"var flashvars = false;"; |
| sSWF += @"var params = { menu: ""false"", flashvars: ""FMSServerURL=" + |
| sServer + "&sID=" + sStreamID + |
| "&imgURL=" + imageURL + @""" };"; |
| sSWF += @" var attributes = { id: ""myDynamicContent"", name: ""myDynamicContent"" };"; |
| sSWF += @"swfobject.embedSWF(""presoViewer.swf"", ""flashContent"", """ + swfWidth + @""", """ + swfHeight + @""", ""9.0.0"", """", flashvars, params, attributes);"; |
| sSWF += "</script>"; |
| Type cstype = this.GetType(); |
| ClientScriptManager cs = Page.ClientScript; |
| cs.RegisterStartupScript(cstype, "SWFScript", sSWF, false); |