Hi dharmendr,
Thank you so much for your help. You have been a great help in the past as well. The good news is the solution you provided me actually solved half of my problem. Just like you said I added the code into the script and then whenever the page loads it keeps the txtUsername value and automatically activates the stored procedure. In the past, it never automatically activates the stored procedure on page load/refresh. So that part is solved. However, the issue I still have is I still have to enter value in the txtUsername and then click the submit button. Only then the stored procedure gets activated.
But what I want is the stored procedure to be active even when you first browse and the website opens for the first time. Then you type a name in the txtUsername textbox and if similar name exists in database, the <span id="Username_Check"> automatically displays the message “Username already taken.” without clicking the Submit button. That is the problem I couldn’t solve. I tried to change the onkeyup attribute to oninput but no luck. The only way it works right now is if I enter the name into the textbox and then click the submit button. But I want it to detect without clicking the button. Hope you better understand my issue now. You already solved half the problem!
Thank you in advance for your help