I would like to share my problem with you in detail.
1) I have a textbox and a button in my page consider it as home.aspx
2) I have written the code like this:
<asp:Button id="btnSubmit" runat="server" Text="Submit" PostBackUrl="~\search.aspx"
OnClientClick="validate();" />
3) I have to check wheteher the textbox is null. If not null i want to redirect to search.aspx as given in the postbackurl.
4) Using java script i have validated;
function validate()
{
if(document.getElementById('txtCity').value!='')
{ alert('please enter the city to search'); returnn false;}
}
5) If the textbox is null. It alerts to enter the city. If not the page remains. It is not redirected to the search page.
I hope you can..