Hi There,I've created a single form to maintain email/newsletter subscription. I would like, to provide a unsubscription url like @/unsubscription?Email=test@test.test@.
Which will show previous subscription details. Then while submitting form will update the details.I've gone through several articles. there could be two possible solution on this.1) Customize C# code for InsertAfter Event. Since I want to keep last updated record, so I need to add code to delete previous record of emailId.2) Customize SetupControl method of SetBizform.ascx.cs. There need to provide ItemId will open the form in edit mode. on submit will update the existing record. Will not add a new record.
// Get the biz form item, and set form control values
var bizFormItem = BizFormItemProvider.GetItem(ItemID, className);
if (bizFormItem != null)
{
// Set the item ID
viewBiz.ItemID = bizFormItem.ItemID;
}I believe option 2 is better than option 1, but I also think we should not alter main kentico files.
Please suggest on above.
↧