Interview Question
Qus: Suppose we need a certain ASP.NET function to be executed on mouse-over over a certain button or textbox. Where do we add an event?
Each web control has an ability to add the attributes on client side that will execute on client side and run a client-side script like a JavaScript function.
Ex – btnSubmit.Attributes.Add (“onMouseOver”,”someClientCode();”)
TextBox.Attributes.Add(“onFocus”,”ClearText();”)
Answers (2)
For Example -
btnSubmit.Attributes.Add(”onmouseover”,”yourClientCodeComesHere”);
Ex – btnSubmit.Attributes.Add (“onMouseOver”,”someClientCode();”)
TextBox.Attributes.Add(“onFocus”,”ClearText();”)