I have a button click action that I need to call some javascript in from the code behind, in order for it to execute after the button click action code has executed
the function works fine when called from the aspx file, the js file is being set in the page_load event as so:
Dim s1 As String = "<script type=""text/javascript"" src=""Default.js" & rnd & """></script>"
Me.ClientScript.RegisterStartupScript(Me.GetType, "DefaultLnks", s1)
this is the button, its legacy code using devexpress controls :(
<dx:ASPxButton ID="btnLoadData" runat="server" Text="Refresh Data"></dx:ASPxButton>
this is what i have in the code behind to execute at the end of the button click event:
Dim jsExecute = "<script type='text/javascript'>refreshData();</script>"
Page.ClientScript.RegisterStartupScript(Me.GetType(),"refreshData()", jsExecute)
the problem is it is not reaching the function when being called, no errors, it just never gets there. I need it to execute from the code behind as it needs to happen after some data import that happens on the button click event.
"<script type='text/javascript'>alert('Hello!');</script>"work?refreshData()function?<div>, and set its onclick to runrefreshData(), does that work?