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

Server side event not getting fired on button click

2 Answers 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hrushikesh Mokashi
Top achievements
Rank 1
Hrushikesh Mokashi asked on 09 Sep 2008, 11:43 AM
Hi All,

I am using Master And content page.

In Master page
I have used RadScriptManager,RadAjaxManager and RadAjaxLoadingPanel.

In Content Page

I am using RadTabStrip,RadMultipageView,RadAjaxManagerProxy.
In RadPageView I added RadGrid,RadDatePicker and Button.

I have added ajax setting on RadTabstrip and radMultiPageView control.

On button onClientClick i added javascript function which return true or false according to value of textbox.

Issues
1>On button click it not going to its serverside event ,when clientside function return true.
a> if button is replace with linkbutton then it works.

Ajax setting are folllows
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
      <ajaxsettings>       
         <telerik:AjaxSetting AjaxControlID="rtabTemp">
              <updatedcontrols>
                  <telerik:AjaxUpdatedControl ControlID="RadMultiPageMain" />
              </updatedcontrols>
          </telerik:AjaxSetting>
         
                  
         <telerik:AjaxSetting AjaxControlID="RadMultiPageMain">
              <updatedcontrols>
                  <telerik:AjaxUpdatedControl ControlID="rtabTemp" />
              </updatedcontrols>
          </telerik:AjaxSetting>
  </ajaxsettings>
    </telerik:RadAjaxManagerProxy>

//ClientSide function call on button onClientclick

  function DateValidLst()
            {      
                var SerScheDateLst =document.getElementById('<%=dtpStartDateLst.ClientID %>').value;

                if (SerScheDateLst == "") {
                    alert("You have selected Invalid Date. ");
                    return false;
                }
                else
                    return true;
            }   
                

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 09 Sep 2008, 11:46 AM
Hi Hrushikesh,

Here is an example how to use this client-side function for OnClientClick:

... OnClientClick="if(!DateValidLst()) return false;" ...

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Hrushikesh Mokashi
Top achievements
Rank 1
answered on 09 Sep 2008, 12:10 PM
I added line you suggested.
It works
Thanks.
Tags
General Discussions
Asked by
Hrushikesh Mokashi
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Hrushikesh Mokashi
Top achievements
Rank 1
Share this question
or