Is there a way to cause a full page refresh from an ajaxified control?
Here is the scenario:
I have a ajaxified grid with a delete column that is in a user control. When the user clicks the delete button, if an error occurs, I would like to be able to write the error to an error control that I have on the master page.
I have been able to add it to the property required to display the error messages, but because the page isn't being redrawn, the error message never displays and the user is left wondering why the record didn't delete.
Thanks,
Dennis
Here is the scenario:
I have a ajaxified grid with a delete column that is in a user control. When the user clicks the delete button, if an error occurs, I would like to be able to write the error to an error control that I have on the master page.
I have been able to add it to the property required to display the error messages, but because the page isn't being redrawn, the error message never displays and the user is left wondering why the record didn't delete.
Thanks,
Dennis
7 Answers, 1 is accepted
0
Hi Dennis,
One possible option in this case would be to refresh the page on the client, like this:
.js
Best wishes,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
One possible option in this case would be to refresh the page on the client, like this:
.js
| function refresh() |
| { |
| window.location.reload(); |
| } |
| </script> |
Best wishes,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dennis
Top achievements
Rank 1
answered on 07 Jan 2009, 05:31 PM
Thanks Yavor.
I put this function in the .js file the master page is using. How do I call this method from the user control's code behind file?
I put this function in the .js file the master page is using. How do I call this method from the user control's code behind file?
0
Hi Dennis,
The following topic includes additional information on one possible option in this case.
I hope it helps.
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The following topic includes additional information on one possible option in this case.
I hope it helps.
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dennis
Top achievements
Rank 1
answered on 08 Jan 2009, 06:25 PM
Thanks Yavor. That doesn't really seem to help.
I would think that other people have run into this issue before.
How do people display errors that occur in ajaxified user controls to the page if the page never refreshes?
I would think that they would have to have some way to tell the user that an error occurred in the control. I can't image having a component that reads or inserts data into a database, encounters an error and doesn't tell the user. It would just look like nothing is happening.
I tried to redirect to the current page, but then I lose the values that I have been working with.
Thanks for your help,
Dennis
I would think that other people have run into this issue before.
How do people display errors that occur in ajaxified user controls to the page if the page never refreshes?
I would think that they would have to have some way to tell the user that an error occurred in the control. I can't image having a component that reads or inserts data into a database, encounters an error and doesn't tell the user. It would just look like nothing is happening.
I tried to redirect to the current page, but then I lose the values that I have been working with.
Thanks for your help,
Dennis
0
Dennis
Top achievements
Rank 1
answered on 08 Jan 2009, 07:41 PM
Yavor,
I tried your code sample in my user control component.
In the delete method of the user control, it catches the exception and, for now, runs this code:
I tried your code sample in my user control component.
In the delete method of the user control, it catches the exception and, for now, runs this code:
string
script = "<script type='text/javascript'>alert('hi');</script>";
CommentsRadAjaxPanel.Controls.Add(
new LiteralControl(script));
Nothing displays on the screen when this code runs. I was expecting an javascript alert window.
0
Hi Dennis,
Based on this information, it is hard to determine what is causing the script to fail.
If the issue persists, you can open a formal support ticket, and supply a small project, demonstrating your logic, for additional review.
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Based on this information, it is hard to determine what is causing the script to fail.
If the issue persists, you can open a formal support ticket, and supply a small project, demonstrating your logic, for additional review.
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
PatD
Top achievements
Rank 1
answered on 23 Nov 2009, 04:00 PM
Dennis,
Maybe it is too late for you but this solution may be useful for others.
This works for me. After an ItemCommand in my grid (insert, delete), I wanted too refresh a control outside my grid.
Try to add a RadAjaxManager:
Maybe it is too late for you but this solution may be useful for others.
This works for me. After an ItemCommand in my grid (insert, delete), I wanted too refresh a control outside my grid.
Try to add a RadAjaxManager:
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="yourGrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="yourControlOutsideYourGrid" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
Good Luck.