Hi,
Its very easy, assumed that you have a textbox and a button and you want to alert the user on the button click if its text is empty,
<table>
<tr>
<td>
<asp:textbox id="txtTest" runat="server" xmlns:asp="#unknown"></asp:textbox>
</td>
<td>
<asp:button id="btnTest" runat="server" text="Click Me!!!" onclientclick="return ShowAlert();" xmlns:asp="#unknown" />
</td>
</tr>
</table>
now here is the javascript function to get the alert when the textbox is empty.
<script type="text/javascript">
function ShowAlert() {
var txt = document.getElementById('txtTest').Value;
if (txt == '') {
alert('textbox is empty');
if (confirm('Do you want ot proceed?')) {
alert('proceeding................');
}
else {
alert('canceled.................');
}
}
}
</script>