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

[Solved] telerik:RadAjaxManager is showing problem on client side function in asp.net button?

2 Answers 160 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
shaik
Top achievements
Rank 1
shaik asked on 28 May 2008, 07:39 AM

Hi Telerik team,

i'm using both client side & server side event on delete button.
The problem is server side event is not calling after confirm message ok.
After confirm was ok,i'm deleting the records.But when i was click ok the server side event is not calling.

<asp:Button ID="btnDelete" runat="server" Text="Delete" OnClientClick="return GetSelectedItems();" OnClick="btnDelete_Click" />
 <telerik:RadGrid ID="rgSamplePlanDashboard" SkinID="CustomTelerikGridSkin" runat="server"> </telerik:RadGrid>

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
  <telerik:AjaxSetting AjaxControlID="btnDelete">
    <UpdatedControls>
      <telerik:AjaxUpdatedControl ControlID="btnDelete" />
      <telerik:AjaxUpdatedControl ControlID="rgSamplePlanDashboard" />
    </UpdatedControls>
  </telerik:AjaxSetting>
</telerik:RadAjaxManager>

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
          function GetSelectedItems()
        {
           test=($find("<%= rgSamplePlanDashboard.MasterTableView.ClientID %>").get_selectedItems().length);
           if (test==0)
            {
              alert('Please Select atleast one Sample Plan Record to delete.');
              return false;
            }
            else if (test>0)
            {
              var DeleteSampleRecors=confirm ("Sample plan record exist with associated sample(s) do you to continue click Ok or Cancel.")
                if(DeleteSampleRecors==true)
                {
                return true;
                }
                else
                {
               return false;

                }
           
            }
      }

         </script>

    </telerik:RadCodeBlock>

    can any one help out to how to overcome this problem.
    plz send the solution ASAP.

    Thanks & Regards
    Shaik Mujeebuddin

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 28 May 2008, 07:56 AM
Hi shaik,

You can try OnClientClick="if(!GetSelectedItems()) return false;" instead.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Partheepan Mani
Top achievements
Rank 1
answered on 08 Jul 2009, 12:36 PM
Hi,
I have one master page with RadAjaxManager and content aspx file. In aspx file, I registed one user control. Inside this user control I have the following button

<

asp:Button CssClass="btnStyle" ID="btnApproveReview" Text="Approve" runat="server"

 

 

OnClick="btnApproveReview_Click" OnClientClick="if (!Validate('btnApproveReview')) return false;" />

And the function Validate(btnObj) contains some validation code which will return false or true. This Javascript Validate function is not get called when I click this button.

Please let me know the solution ASAP.

Thanks in advance,
Regards,
Parthi

 

Tags
Ajax
Asked by
shaik
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Partheepan Mani
Top achievements
Rank 1
Share this question
or