Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Custom NewForm.aspx problem saving with attachments

2 views
Skip to first unread message

Frida

unread,
Dec 10, 2009, 6:37:02 AM12/10/09
to
Hi,
I have a problem with my custom list. I have created a new NewForm.aspx with
a DataFormWebPart created from SharePoint Designer(Insert->Custom list). I
have modified the xsl so that the original attachments field works fine. All
this is ok.

When I save the item with the original OK-button the attachments will be
saved correctly. BUT I want to create my own save button because I have to
save some custom fields from the code behind.

I have tried to create a asp:Button and added a onclick event to it. In the
event I can get the item with SPContext.Current.ListItem but after I have set
my values and done the Update(). The Item gets saved but the attachments are
lost. Can I get them somhow in the code behind and save them by myself or?
Another strange thing is that if it is the first item(ONLY the first) in the
list the attachments are saved but not for the rest of the items in the list.

I have also tried to derive the SharePoint:SaveButton and tried to override
the SaveItem() event, but it wont get fired..

Can anyone help me here?

0 new messages