Pass the Control id as string array and this method will generate script to set the control read only at run time.
public static string MakeControlReadOnly(params string[] ControlIds)
{
System.Text.StringBuilder sb = new StringBuilder(400);
sb.Append("<script language='javascript'>\n");
for (int i = 0; i < ControlIds.Length; i++)
sb.Append("document.getElementById('" + ControlIds[i] + "').readOnly=true;");
sb.Append("</Script>");
return sb.ToString();
}