Hi
I am using devexpress controls in my project. i want to do some client side and serverside code on button click event. My problem is after dispalying the alert , control is going to server side for further processing. I want to check textboexs entered or not. if not alert should come . I am clicking on the alert ok , its going to server code ,pls tell me the solution
Clentside and server side programing in a button click
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 29, 2010, 11:04 PM EDT
That javascript function should return false, if the condition not satisfied else return true, that will go to server side function.
Eg:-
usesubmitbehavior="true"
text="Open Web site"
onclientclick="Navigate()"
runat="server" onclick="Button1_Click" />
function Navigate()
{
javascript:window.open("http://www.microsoft.com");
}
Theresa9 reputationPosted Sep 29, 2010, 11:07 PM EDT
i want to keep the flow of control in the page itself. if textbox is null alert should come and allow to enter value in the teaxtbox .
Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 29, 2010, 11:24 PM EDT
Onclientclick="return Validate()";
function Validate()
{
if (document.getelementbyid(txtbox).value=='')
return false;
else
return true;
}