SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to have a c# file act as a code behind file for an infopath form? Just like you do for forms in aspx. Especially I would like to be able to execute code on page_load for an infopath form and pre populate or modify the fields.

Is this possible?

share|improve this question

For browser-based Infopath forms (the ones requirng Infopath Forms Services of entrprise/paid Sharepoint Server) the custom code is impossible.

The custom (C#, VB.NET) code is possible for client (Infopath Filler 2010) forms.
And kind of, code-behind, since these forms cannot be rendered in a browser.
And rather as plugin code to black-box infopath Filler internals but not of the forms themselves.

share|improve this answer

Your Answer


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.