I got the following event code wich is called when clicking a button:
void addSubject_Click(object sender, EventArgs e)
{
SPWeb thisWeb = SPContext.Current.Web;
thisWeb.AllowUnsafeUpdates = true;
SPList productList = thisWeb.List["Documents"];
SPview view = productList.Views["All Items"];
view.ViewFields.Add("Subject");
view.Update();
productList.Update();
}
On my sitepage, where I inserted the "Documents" web part, nothing happens. However if I click on the "Documents" link to the left to only see the "Documents" list, I can see the view has changed. Also if I choose "Edit web part" and change "Selected View" I can see the changes...So how do I see the changes directly when clicking the button??
Thanks