This is a migrated thread and some comments may be shown as answers.

radpageview button client click prevents server click from firing

5 Answers 118 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Aug 2008, 02:19 PM

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

Sort by
0
Yana
Telerik team
answered on 12 Aug 2008, 01:59 PM
Hello Mark,

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.
0
Mark
Top achievements
Rank 1
answered on 22 Aug 2008, 01:42 PM
Apologies...I forgot to qualify the problem as when the mulitpage is within a an Ajax control.  I've uploaded your sample with the Ajax manager enlisted and the problem occurs as I previously described.

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_click

m_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
0
Yana
Telerik team
answered on 25 Aug 2008, 12:23 PM
Hi 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.
0
Mark
Top achievements
Rank 1
answered on 25 Aug 2008, 05:20 PM
It looks like the 

<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?

0
Mark
Top achievements
Rank 1
answered on 25 Aug 2008, 05:28 PM
Nevermind, doing this works:

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.

Tags
TabStrip
Asked by
Mark
Top achievements
Rank 1
Answers by
Yana
Telerik team
Mark
Top achievements
Rank 1
Share this question
or