0

My main goal with SharePoint is quite simple, I want to develop an intranet heavily based on tables and forms by using a tool/designer which doesn't force me to code all new/edit forms for List entries.

Presently I have a custom form in SharePoint designer to edit a list entry and I would like to add server side code (c#) in order to implement some specific behavior, for instance run a custom Page_Load function.

The issue is that I'm not sure how to do it and which would be the best approach, most of the examples online show an approach using Visual Studio and creating a new list (couldn't even find a way to use an existing SharePoint list) and then code the forms from scratch which I don't want.

So how can I enhance the SharePoint Designer pre-built form (image below) with server side (c#) and client side code (js) ? If possible I would prefer to do it with Visual Studio but I didn't find a way to start customizing an existing Form aspx from VS.

enter image description here

out_sid3r
  • 1,018
  • 2
  • 20
  • 42

1 Answers1

0

My suggestion... if you don't mind using Server Object Model, you could use a Visual WebPart. It's encapsulated and promotes code reusability. From there, you could include client side code, or server side code. Personally I prefer VS to do this, but if you prefer SD, here is a walkthrough https://msdn.microsoft.com/en-us/library/ee231546.aspx

And here is a link on how to include it within an application page

Add a WebPart to an Application page

Hope this helps a bit

Community
  • 1
  • 1
David Espino
  • 2,177
  • 14
  • 21
  • Does it mean I can add it to an existing SharePoint Designer form? – out_sid3r Jun 28 '16 at 16:18
  • I don't understand what do you mean with 'Sharepoint Designer Form' You could configure what `Edit page` you use for a list or library, but it is an Application Page... Basically, the WebPart will be available on your `WebParts Catalog` and it could be added to almost any Page from the Sharepoint portal, or to any `Application page` using VS or SharePoint Designer. – David Espino Jun 28 '16 at 16:22
  • Give it a try... just Create a Visual WebPart with a simple html tag, and follow the second link to include it in that page... Once you see it working, edit your WebPart and include Server controls so you can start adding Object Model Backend Code... – David Espino Jun 28 '16 at 16:23