You can't find out in ASP.NET(C#) as you put it because that only runs on the server side. You can find out on the client side though by adding an onfocus javascript event handler for you textbox controls like this:
<asp:textbox ... onfocus="doItOnFocus(this);" ... >
Then you also need to include some javascript code:
<script type="text/javascript">
function doItOnFocus(element)
{
var stringToInsert = "whatever";
var textBoxID = element.id;
element.value = stringToInsert;
}
</script>
When the textbox gets the focus the javascript function doItOnFocus will be called and
this
will be the HTML input element that corresponds to the asp:textbox element.
Still have questions? Then leave me a comment.
Regards,
Manfred