Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void SubscribeBtn_Click(object sender, EventArgs e)
- {
- string name = subscriptionName.Value;
- string email = subscriptionMail.Value;
- using (var site = new SPSite(SPContext.Current.Web.Url, SPUserToken.SystemAccount))
- {
- using (var web = site.OpenWeb())
- {
- var subscribeList = web.Lists["Newsletter"];
- web.AllowUnsafeUpdates = true;
- SPListItem item = subscribeList.Items.Add();
- item["Title"] = name;
- item["Email"] = email;
- item.Update();
- web.AllowUnsafeUpdates = false;
- .
- .
- .
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement