Monday, November 12, 2012

How to disable client side validation in sharepoint 2010

The validation controls are used get the right input from users.so i have used four validation controls for four text boxes in my web part.Then i was disable those validation based on page mode on server side.If the mode is display mode i will turn on all the validations on site.To turn on the validations we have to set the EnableClientScript property to false
WebPartManager wpmr = WebPartManager.GetCurrentWebPartManager(Page);
Respose.Write(wpmr.DisplayMode);
if (wpmr.DisplayMode == WebPartManager.EditDisplayMode)
{
ReOrderName.EnableClientScript = false;
RaOrderQuantity.EnableClientScript = false;
ReOrderAmt.EnableClientScript = false;
RaOrderAmt.EnableClientScript = false;
}
else if(wpmr.DisplayMode == WebPartManager.DesignDisplayMode)
{
ReOrderName.EnableClientScript = True;
ReOrderAmt.EnableClientScript = True;
}
Post a Comment

Bel