Friday, 14 August 2009

Modifying Web config entries using code

A good place to start would be to look at the SPWebConfigModification class.

 

The documentation around how to use this is hard to come by, but there is an excellent article here.

 

 

 

Thursday, 13 August 2009

Sharepoint Setting Cookies

To Set Cookies you must do the following:

 

cookie = new HttpCookie(“MyCookie”);

cookie.Values["textSize"] = value;

cookie.Expires = DateTime.Now.AddDays(30);

 

HttpContext.Current.Response.Cookies.Add(cookie);

 

It’s the HttpContext bit which makes it persist!