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

Radbutton submit double time when we click in jquery ajax method

4 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sai
Top achievements
Rank 1
sai asked on 25 Feb 2020, 02:06 PM

Sir,

I have radbutton which call a jquery(since this jquery function is available as external file) ajax method to save the record.I have a render mode in my radbutton.If i add this rendermode it post the data for double time for single click.when i remove the rendermode.It is posting for one time.Since this jquery method call ajax for API save.Can any one help on this issue please.Since it is very urgent requirement for me.Please help me

Eg:

<p>&nbsp; &nbsp; &nbsp;&lt;telerik:RadButton ID="btnSavetest" </p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AutoPostBack="false" Primary="true" runat="server" Text="&amp;nbsp;&amp;nbsp;Save&amp;nbsp;&amp;nbsp;"&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ValidationGroup="vgtest"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;CausesValidation="True"&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Skin="CB"&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EnableEmbeddedSkins="false"&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RenderMode="Lightweight"&gt;&lt;/telerik:RadButton&gt;</p>

Jquery eg

<p>Page.savetest=function(){</p><p>var pagedata={</p><p>data1:"data1"</p><p>data2:"data2"</p><p>}</p><p>var url=Page.APILike+Page.fileName+Page.name</p><p>$.ajax({</p><p>url:url,</p><p>type:"post",</p><p>data:savetest,</p><p>success:function(result){</p><p>if(result)</p><p>alert('saved')</p><p>}</p><p><br></p><p>});</p><p>};</p>

 

Can anyone please help on this please

Thanks

4 Answers, 1 is accepted

Sort by
0
sai
Top achievements
Rank 1
answered on 25 Feb 2020, 02:12 PM
Sry for above code.code below
Button 
<telerik:RadButton ID="btnSavetest" AutoPostBack="false" Primary="true" runat="server" Text="&amp;nbsp;&amp;nbsp;Save&amp;nbsp;&amp;nbsp;" ValidationGroup="vgtest"</p><p>CausesValidation="True" Skin="CB" RenderMode="Lightweight"</telerik:RadButton>

 

JQuery sample

Page.savetest=function(){

var pagedata={data1:"data1"</p><p>data2:"data2"}

var url=Page.APILike+Page.fileName+Page.name

$.ajax({

url:url,

type:"post",

data:savetest,

success:function(result){

if(result)

alert('saved')

}

});

};

0
sai
Top achievements
Rank 1
answered on 25 Feb 2020, 02:18 PM
this particular issue is happening only for chrome and firefox not IE
0
sai
Top achievements
Rank 1
answered on 26 Feb 2020, 06:51 AM
can anyone help on this please.since this is a urgent 
0
Vessy
Telerik team
answered on 28 Feb 2020, 12:47 PM

Hi Sai,

Basically, the main difference between the Lightweight and classic render mode is that in Classic the buttons main element is a <span>, while in lightweight - a <button>.Can you, please, provide a little more details about the exact scenario in which you are facing the problem?

  • Which version of the controls is used in your application?
  • Are you using the Page.savetest() function as a handler to the buttons OnClientClicked event?
  • If so, in which moment of the page life cycle are you attaching the handler?
  • Are there any other ajax updates on the page (made client-side or via update panels)?

It will be really helpful if you can prepare and send me a small sample in which I can reproduce the problem and debug the exact setup leading to it. You can see how to prepare such easily here:

https://www.telerik.com/blogs/isolating-a-problem-in-a-sample-project

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
General Discussions
Asked by
sai
Top achievements
Rank 1
Answers by
sai
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or