I have created a custom New.aspx for a custom list with visual studio. I have designed user control for this. I'm able to submit the items to the list.
However, i have a problem with attachment file and adding it to the list. This is the code that i use to add an attachment to the custom list.
SPListItem currentItem = SPContext.Current.ListItem;
MyAttachments.UpdateFieldValueInItem();
currentItem.Update();
When i debug the code , i could see that MyAttachments is null, i'm clueless .
Your suggestions/help is appreciated.