I have an asp button within a radpageview (of the rad mulitpage control connected to the rad tab strip) that represents a delete function. I add a click click in code behind like so:
m_btnDeleteUser.Attributes.Add("onclick", "javascript:return confirm('You you sure');");
This works fine on buttons not in the radpageview, when in the radpageview, the confirm dialog box pops up, but the return true (clicking ok button) does not allow the server side click event to fire.
This thread talks about something similar http://www.telerik.com/community/forums/thread/b311D-bkektd.aspx
But I'm not using tab template, I'm just inside the radpageview control. Is it essentially the same isssue?
Thanks.
Mark
5 Answers, 1 is accepted
I tested the described scenario and it worked as expected at our side. Please check the attached sample project for a reference.
Regards,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Correction: reply to thread does not appear to allow me to include an attachment.
Here's what changed:
added to aspx:
<telerik:RadAjaxManager runat=server ID="ram1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadTabStrip1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="m_lblmsg" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="m_btnDeleteUser">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="m_lblmsg" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
and a label at the bottom after the </div> and before the </form><asp:Label runat=server ID=m_lblmsg ></asp:Label>
In code behind added to m_btnDeleteUser_clickm_lblmsg.Text =
"You click Delte user";
This message doesn't display. Remove the ajax and it does. Debug and you'll see the event is not fired.Hope this helps.
Mark
Please find attached modified project so that now the click event is fired. Download it and give it a try.
Regards,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
<telerik:RadAjaxManager runat="server" ID="ram1" ClientEvents-OnRequestStart="responseStart()">
Will fire the jscript method for every control that has a client event. For example, if I have another button (e.g. Create User), which wants to show a create user panel. The Are you sure prompt would fire for that also?
Or do I create a separate RadAjaxManager instance for each control that I want to control in this manner?
if (!IsPostBack)
{
// This works.
m_btnDeleteUser.Attributes.Add(
"onclick", "responseStart('Are you sure you want to delete me?');");
}
My issue was that I need to set the message in code behind, because the message string is going to be localized to a particular language at run time.