Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# code-behind file doesn't work with Infopath

C# code-behind file doesn't work with Infopath

Scheduled Pinned Locked Moved C#
helpcsharpdotnetvisual-studiocom
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Getman
    wrote on last edited by
    #1

    Hi, I found a problem during Infpath Project development in VS 2005. I've created a new project in VS 2005 (Office -> Infopath form), this project is a simple Infopath Form wich will recieve and submit some data to my web-service. First of all I should notice that I didn't created any DataSource in design-time from Infopath Forms Designer, instead I am making all calls to web-service methods and filling Infopath forms controls from C# code-behind file. Then I wrote some C# code in generated Form's code-behind file, also I've added a WebReference to my web-service and wrote code for web service methods calls and Infopath controls filling. When I starting my project from VS (F5 or Ctrl + F5) everything works fine and I see the controls on my Infopath form are filled with data from web service. The problem occurs when I am making Project - Publish Form, the published form (xsn file) contains all dll and other necessary files, but when I runnig published form all controls are empty! It seems like my C# code doesn't executed and no exception or error messages does not appear. Does enybody knows what happens? I suppose that I should change my security configuration setting in .NET Framework configuration, is that correct? Thank you for your help or any ideas. xedom developers team personal web page

    A 1 Reply Last reply
    0
    • A Alex Getman

      Hi, I found a problem during Infpath Project development in VS 2005. I've created a new project in VS 2005 (Office -> Infopath form), this project is a simple Infopath Form wich will recieve and submit some data to my web-service. First of all I should notice that I didn't created any DataSource in design-time from Infopath Forms Designer, instead I am making all calls to web-service methods and filling Infopath forms controls from C# code-behind file. Then I wrote some C# code in generated Form's code-behind file, also I've added a WebReference to my web-service and wrote code for web service methods calls and Infopath controls filling. When I starting my project from VS (F5 or Ctrl + F5) everything works fine and I see the controls on my Infopath form are filled with data from web service. The problem occurs when I am making Project - Publish Form, the published form (xsn file) contains all dll and other necessary files, but when I runnig published form all controls are empty! It seems like my C# code doesn't executed and no exception or error messages does not appear. Does enybody knows what happens? I suppose that I should change my security configuration setting in .NET Framework configuration, is that correct? Thank you for your help or any ideas. xedom developers team personal web page

      A Offline
      A Offline
      Alex Getman
      wrote on last edited by
      #2

      I've found solution! To execute C# code with Web Reference to web-service you must digitally sign your Infopath form. It can be done through Tools -> Form Options - Security: 1. Uncheck Automatically... and select full trust 2. Check sign and create certificate 3. Publish the form or you should create a msi project to install your Infopath form. find out more... xedom developers team personal web page

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups