I am not sure if we call them application pages or something else but am talking about standard sharepoint forms like "NewForms.aspx" or "EditForm.aspx" for lists in 12 hive.

Does they have any code behind as when I opened a standard form in notepad I can see its inheriting from

<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint

but doesn't have any attribute for code behind file, so if I want to execute some code using object model in Page_load method then I will have to create a custom form with code behind file as I need to get things from DB and am not so willing to use Javascript ?


You have to create your own custom ones and bind them to the list in your list template (or modify it through code).

If you for example navigate to "http://yourserver/Lists/YourListName/NewForm.aspx"; you can view the form. All it is, is a webpartpage with a ListFormWebPart on it. If you go to "http://yourserver/Lists/YourListName/NewForm.aspx?contents=1"; you can see the web parts on the page. Bear in mind that you should never edit the original files in the 12 hive. If you want to change them, make a copy of the original and provision the new one.

The NewForm.aspx in the 12 hive is only a template. It is provisioned in the database each time a new list is created.


Create an webpart with no front-end, overwrite CreateChildControls (or any other page event that you find suitable to your need but if you are unsure go with CreateChildControls) and write your logic inside it, add the webpart in the form opening the page in edit mode, but as suggested by @Grooverinthesouth dont edit the default one, make a copy of it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.