Redirect to external site with parameters - InfoPath Dev
in

InfoPath Dev

Redirect to external site with parameters

Last post 02-10-2009 04:42 AM by Sheena. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-27-2008 02:32 PM

    Redirect to external site with parameters

    Hi,

    I am implementing a browser-compatible Infopath based solution, where on submit button click, I need to redirect the user to another website, and also pass query string to that website.

    Any idea on how to achieve this? There doesnt seem to be any Respose.Redirect type method. Also, how do I pass query string parameters.

    Basically, on click of a button on Infopath web based form, I want the page to navigate to a URL like https://servername/subpath/filename?a=value&b=value

    Please help - have been stuck over this for a long time ... I am completely new to Infopath development

  • 10-29-2008 01:01 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Redirect to external site with parameters

    Hello Welcome to the Forums,

    Which ever you given link are correct if we pass the value for it? Then we can create this format link in code,

    string url = string.Format("https://servername/subpath/filename?a=%7b0%7d&b={1}", valueA, valueB);

    we can pass this url for navigating to that form.

  • 10-29-2008 01:18 AM In reply to

    Re: Redirect to external site with parameters

    Hi Shiva, Thanks a lot for your reply. However, it doesnt address my question completely. Forming the URL is not a problem.

    I have a button on the browser enabled InfoPath form. Something like a submit button. On click of that, I need to take the value from one of the text boxes in the Infopath form, and then redirect the user from Infopath based browser form to some external site.

    How do I achieve that in a button click event? Once the user clicks the button, the user should be redirected to some external site which I specify. Any idea how to do that?

    Regards,

    Dhruman

  • 10-29-2008 03:28 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Redirect to external site with parameters

     

    Hello,

    You have to write the below code in onClick event of your button,

    1. For getting the text box value,

    string textValue = XDocument.DOM.selectSingleNode("XPath of your field").text;

    2. Prepare the url using above value.

    3. Using below code we can open the form,

    Application.XDocuments.New(<Url of the form>, 1);

    Note: In this we can't redirect to the above url. But we can close the exist form and open the new form.

  • 10-29-2008 03:57 AM In reply to

    Re: Redirect to external site with parameters

    Thanks for the reply, Shiva ...

    I specifically want to redirect from Infopath to external website. I am aware of the above method to open another InfoPath form. However, that is not what I want.

    Do let me know if there is any way to redirect to an external website and pass query string as well

    Thanks a lot!

    Dhruman

  • 11-04-2008 08:12 AM In reply to

    Re: Redirect to external site with parameters

    Wouldn't putting your external URL in place of <Url of the form> from the previous post pretty much be the same thing. One points to the location of a form, one points to an external website. Both are in URL form so the it shouldnt really make a difference should it? Just an idea

  • 02-10-2009 04:42 AM In reply to

    • Sheena
    • Not Ranked
    • Joined on 02-10-2009
    • Posts 1

    Re: Redirect to external site with parameters

    hi,

    have gone through your post and your problem, even i' m facing the same issue

    i have a web-enabled infopath form with a close button - i want to save some data through code-behind in SQL and then after a successful save, i need to close the form and redirect to the previous page within the site.......BUT IT DOESNOT WORK

    Please help me to solve the same.....

    Need your assistance

    Regards

    Sheena 

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.