سؤال

I created a web form with the following controls:

        enter image description here

Notice that there are 12 buttons, all of which fundamentally do the same thing. Is it possible to have one method (not twelve) that handles their OnClick event?

هل كانت مفيدة؟

المحلول

Yes, just in the object sender part of the event you parse the sender into a TextBox and get the id of the sender in order to know what to do.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top