I have one aspx page where I need to validate some fields, I made this validation on C# code, but there wasn't working.
So I tried put a simple code only to discover what was the problem, so I realized that didn't matter the code, if I run a ScriptManager.RegisterStartupScript or a ScriptManager.RegisterClientScriptBlock, my C# code doesn't work.
Here is an example:
protected void btnBuscar_Click(object sender, EventArgs e){
this.lblValidarEmpresa.Visible = false;
ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "script", "AplicarMascara();", false);
}
The function AplicarMascara() applies a data mask on a text field.
Do you know how solve this problem? Or any other way to apply this mask without use ScriptManager?
Thanks.
On the first sight, try to change last parameter (addScriptTags) to true.