Hi Guys, after doing some research and some self testing I have found the solution for this.
Since the page is getting page load after the click of submit button, the SPAN value is getting cleared. So i have returned false from my Javascript function. That is
var errormessagespan = document.getElementById('<=errorMessageSpan.ClientID>');
if (textbox.value == "") {
errormessagespan.innerHTML = "please enter the value for textbox1";
return false;
}
and i have given my submit button onclick as
<input type="submit" value="Submit" runat="server" disabled="disabled" önclick=" return validateTextbox()" id="submitButton" />
Now the SPAN value is getting displayed properly and no more its getting cleared.
Thanks for putting your time and please do accept my solution if you feel it works fine for you.
Have a great day world :)