Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 ?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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