nobitavn94 Posted November 11, 2006 Share Posted November 11, 2006 Hi all !I have a problem that I need your help .I'm using .NET 2003.In login page (has many info user must to fill in ),when user focus an text box used to enter username ,I want to display an button (named Check avalabilty) allowing user to check if the username he has filled is exist (and I done this).But I don't now how to catch clicked event of this button (I want to write the function handling this event in C# because this function has to access to database ).I wonder if my way is correct ???.Here is the code :<script language="javascript">function Focus(){ document.getElementById("spBnCheck").innerHTML="<input type='submit' id='bnCheckUsrName' value='Check avability'>";}</script>Thanks you very much ! Link to comment Share on other sites More sharing options...
aspnetguy Posted November 12, 2006 Share Posted November 12, 2006 you cannot catch the this button in .Net because it was created after page load and it is not a server control Link to comment Share on other sites More sharing options...
Jonas Posted November 12, 2006 Share Posted November 12, 2006 How about including a button in the code, hiding it with css and bringing it back with javascript on focus. Would that work? Link to comment Share on other sites More sharing options...
aspnetguy Posted November 12, 2006 Share Posted November 12, 2006 yes that would work, it is about the only way to have .Net capture the click event Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now