We have several clients that would like to have some fields on the personal information web site screen read only. In system setup ->set up customer web components -> personal information configuration you can make member type read only but that is the only one. Does anyone have any suggestions regarding making fields read only on the web?
Thank you in advance for your time,
Paige
Sample Code
Hi Paige,
See some sample code below that we used for a client on the personal page in public view. Of course if you modify the Personal.aspx page you will need to consider this every time you apply a patch or upgrade. We have started to implement these types of changes to the page in an HTTP Module that drops the required code on the page dynamically and does not require modifying the out of the box page. I hope this helps.
Thanks
Joe
<
script runat="server"> override void OnPreRender(EventArgs e)DropDownList ddl;TextBox t;DropDownList) Page.FindControl("ctl00$TemplateBody$ddMemberTypes");if (ddl != null)false;Color.LightGray;TextBox)Page.FindControl("ctl00$TemplateBody$txtCompany");if (t != null)true;Color.LightGray;TextBox)Page.FindControl("ctl00$TemplateBody$txtMajorKey");if (t != null)true;Color.LightGray;DropDownList)Page.FindControl("ctl00$TemplateBody$ddChapter");if (ddl != null)false;Color.LightGray;
</
script>
protected
{
ddl = (
{
ddl.Enabled =
ddl.BackColor = System.Drawing.
}
t = (
{
t.ReadOnly =
t.BackColor = System.Drawing.
}
t = (
{
t.ReadOnly =
t.BackColor = System.Drawing.
}
ddl = (
{
ddl.Enabled =
ddl.BackColor = System.Drawing.
}
}