I want to restrict sinqle qoute in text box through keypress event.
private void PAddress_Text_KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar==''')
{
e.Handled=true;
}
}
I tried with above code.
But I am getting Empty character literal error in the IDE(Visual Studio IDE).
You need to escape the single quote: