Hi
I've a project which is using infragistics 10.3 and the aspx page has a grid. on cell value change I would like to call javascript function which is in sepreate file.
see the code below.
// script manager
<ig:WebScriptManager ID="WebScriptManager1" runat="server"></ig:WebScriptManager>
// Update cell event.
protected void grdMainSummary_RowUpdating(object sender, Infragistics.Web.UI.GridControls.RowUpdatingEventArgs e){}
I am using below code to call javascript function from code behind , it work fine when I called it from onload event but not working on "grdMainSummary_RowUpdating" event.
ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowStatus", "MyFunction();", true);
Regards
Hello,
By default, RowUpdating is an asynchronous event and that would prevent your JavaScript from being executed. The simplest solution would be to change the AutoPostBack flags so that the event is a full post back rather than an async event though this will have a negative impact on the end user experience and it would be better to use some alternative. What is it that you are doing in response to the row updating event on the server that you need to change on the client? Is there a reason that you don't use a client side event of the grid to call your JavaScript?
It will help to have a more complete picture of what you are doing to suggest the best approach to take.
Let me know if you have any questions with this matter.
I also tried to call below on pagepostback = true. still not working.
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Key", "alert('sadsa')", true);
What are you doing in this JavaScript function you want to call? What is the behavior you are trying to achieve?
HI,
I would like to call a javascript function which is on a seprate javascript file. on updating cell value.
regards
Thank you for the update, I have some follow up questions:
What does the JavaScript function do?What is the code in the JavaScript function?Why does this have to be called on the server/can you call this from the client side updating event instead?
In that case I would recommend you use the client side row updating event to call your other JavaScript method. You can see the following link for how to setup this event:
http://help.infragistics.com/doc/ASPNET/2016.1/CLR4.0/?page=Infragistics4.Web.v16.1~Infragistics.Web.UI.GridControls.EditingClientEvents~RowUpdated.html
I have a chat application which is using signalR. Chat application has two pages
1) Admin Page
2) Chat Page
Admin page has grid with columns such as starttime , endtime etc. Which can be set a run time during chat such as endtime. When user edit the chat endtime I would like to call a javascript function which will do following
timerInterval = setInterval(myTimer, MaxDurationMinutes);
Everything working fine only thing I need is to call javascript function on Rowupdating and set interval.