I'm working on a visual webpart and i need to create a custom property text field.This will be used to set how many days password would expire. See below:
[WebBrowsable(true),
Category("AD Configuration"),
Personalizable(PersonalizationScope.Shared),
WebDisplayName("Enter days for Passwords to Expiry"),
WebDescription("AD Password Expiry")]
public Int32 LdapProp
{
get { return expvalue; }
set { expvalue = value; }
}
public static Int32 expvalue;
and then set it like this:
DateTime expDate = DateTime.FromFileTime(LngString).AddDays(VisualWebPart1.expvalue);
When i edit the webpart the default is set to 0.
Then when i set it to e.g 25 and click apply it doesn't work first then when i refresh the page it works.
Just wondering is this the right way to do it and why doesn't it resfresh automatically.
Ami i missing on the pre render or something?