how to open a new infoPath web form from an infoPath web form with managed code - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

how to open a new infoPath web form from an infoPath web form with managed code

Last post 12-22-2011 07:43 AM by canadiense. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-26-2010 12:01 PM In reply to

    Open a new infoPath web form from an infoPath web form with managed code

    I am having an issue with infoPath Forms and C#,
    I have a 1st form open to the user, and when he click a button it opens a 2nd form.

    Sounds pretty easy, but I have tried many ways and still error.
    (environment is InfoPath Forms 2007 in Sharepoint and code: C#)

    this is what I have:
    - form1 . a text field where I enter the URL of form2
                . a button with code below

    The issue is that if I type the URL of form2
    (http://sharepointserver/sites/MySiteCol/Myinfopath/_layouts/FormServer.aspx?XsnLocation=http://sharepointserver/sites/MySiteCol/FormServerTemplates/form2.xsn&SaveLocation=http://sharepointserver/sites/Myinfopath/InfoPathLib)
     in the text field and press the button I get this error
    "Critical Error : An error occurred submitting this form to the Web server. The form will now be closed."

    But instead of the URL of form2.xsn I type http://www.google.com they it works (well except the image somehow, but that's not the problem)

    using Microsoft.Office.InfoPath;
    using System;
    using System.Xml;
    using System.Xml.XPath;
    using System.Web;
     // get the text field entry
    string out_URL  = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:textURLField", NamespaceManager).Value;
    // now go to that URL
    HttpContext.Current.Response.Redirect(out_URL  , false); --> is not working for complex address, but works for simple domain (http://google.com)

    PS: form1 & form2 are both Forms compatible + FullTrust security.

    So.. WHAT'S WRONG WITH THIS or WHAT IS THE BETTER WAY TO OPEN A NEW FORM FROM AN INFOPATH FORM ? 
    (please don't say "Application.XmlForms.NewFromFormTemplate" as it' not compatible with InfoPath forms, only client)

    Many many thanks, you would save my day/week/infopath future projects.

  • 03-01-2010 02:30 AM

    how to open a new infoPath web form from an infoPath web form with managed code

    (I did post  this question in the infopath/sharepoint forum, but now realised it's a general infopath newbie and not just sharepoint related, so here it is if someone can give directions for help, thanks.)


    I am having an issue with infoPath Forms and C#,
    I have a 1st form open to the user, and when he click a button it opens a 2nd form.

    Sounds pretty easy, but I have tried many ways and still error.
    (environment is InfoPath Forms 2007 in Sharepoint and code: C#)

    this is what I have:
    - form1 . a text field where I enter the URL of form2
                . a button with code below

    The issue is that if I type the URL of form2
    (http://sharepointserver/sites/MySiteCol/Myinfopath/_layouts/FormServer.aspx?XsnLocation=http://sharepointserver/sites/MySiteCol/FormServerTemplates/form2.xsn&SaveLocation=http://sharepointserver/sites/Myinfopath/InfoPathLib)
     in the text field and press the button I get this error
    "Critical Error : An error occurred submitting this form to the Web server. The form will now be closed."

    But instead of the URL of form2.xsn I type http://www.google.com/ they it works (well except the image somehow, but that's not the problem)

    using Microsoft.Office.InfoPath;
    using System;
    using System.Xml;
    using System.Xml.XPath;
    using System.Web;
     // get the text field entry
    string out_URL  = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:textURLField", NamespaceManager).Value;
    // now go to that URL
    HttpContext.Current.Response.Redirect(out_URL  , false); --> is not working for complex address, but works for simple domain (http://google.com/)

    PS: form1 & form2 are both Forms compatible + FullTrust security.

    So.. WHAT'S WRONG WITH THIS or WHAT IS THE BETTER WAY TO OPEN A NEW FORM FROM AN INFOPATH FORM ? 
    (please don't say "Application.XmlForms.NewFromFormTemplate" as it' not compatible with InfoPath forms, only client)

    Many many thanks, you would save my day/week/infopath future projects.

  • 12-22-2011 07:43 AM In reply to

    Re: how to open a new infoPath web form from an infoPath web form with managed code

    Francois (still in London?) ...

    Wondering if you ever figured this one out ... I know this was posted a long time ago, so I'm just askin'! :)

    Thanks.

    Chris ... er, Arthur Fonzarelli!
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.