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
Loading
Manikavelu VelayuthamPosted Sep 30, 2010, 3:24 AM
Onclientclick="return Validate()";
function Validate()
{
if (document.getelementbyid(txtbox).value=='')
return false;
else
return true;
}
TheresaPosted Sep 30, 2010, 3:07 AM
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 VelayuthamPosted Sep 30, 2010, 3:04 AM
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");
}