Hi,
Environment: RadControls for ASP.NET AJAX Q3 2009 / VS 2008 SP1/IE7/WINXP SP 2.
I am using Master Detail Form Template for Insert updates.. Below is my form Template Insert/Update Command..
My Question is that on Update Event how can I show a Popup Rad Alert or Javascript Alert.. Below is my Update Command...
Instead of showing the alert:
Location already exists for the selected user
Environment: RadControls for ASP.NET AJAX Q3 2009 / VS 2008 SP1/IE7/WINXP SP 2.
I am using Master Detail Form Template for Insert updates.. Below is my form Template Insert/Update Command..
| <td align="right" colspan="2"> |
| <asp:Button ID="btnUpdate" runat="server" CssClass="form-button" |
| CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' |
| Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| /> |
| |
| <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CssClass="form-button" |
| CommandName="Cancel" Text="Cancel" /> |
| </td> |
My Question is that on Update Event how can I show a Popup Rad Alert or Javascript Alert.. Below is my Update Command...
| protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) |
| { |
| ... |
| if (id == 0) |
| // if (result != null) |
| { |
| SqlDataSource2.UpdateParameters["Program"].DefaultValue = combo.SelectedItem.Text; |
| e.Canceled = false; |
| } |
| else |
| { |
| string user = "John Doe";
string stlocation = "Your Location"; |
| RadAjaxPanel1.ResponseScripts.Add(string.Format("alert('Location already exists for the selected user');")); |
| e.Canceled = true; |
| } |
| } |
Instead of showing the alert:
Location already exists for the selected user
I would like to show:
John Doe, Location already exists for the selected user from: Your Location. .
As you will notice, I stored John Doe in string user and Your Location in stlocation..
Is it possible this can be done via a Javscript Function and this whole string "John Doe, Location already exists for the selected user from: Your Location" can be pass as argument or parameter. This way I can call the same Function over and over from other events just by passing the parameter.
Thanks
GC_0620