# Handle OnClick in Jquery or C#

I am working on a webforms project using c#/aspx/jquery. I'm not sure where to handle my Onclick. Both options (doing it in C# or jquery) seem feasible. Which would be better practice?

Here is the scenario:

I want to build a checkbox which will toggle a textbox's textmode, altering it between Password and SingleLine.

Currently, I have this following code for my markup since I am currently handling it in C#:

<asp:Checkbox ID="CheckBox1" OnCheckedChanged="CheckBox1_OnCheckedChanged"/>


The code:

protected virtual void OnCheckedChange(EventArgs e)
{
CheckBox1.TextMode = TextMode.SingleLine;
else
}


The use case of this is: A user is entering his password. On the same page, he may choose to keep the password hidden or not by checking the checkbox.

-