.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to redirect Infopath form programmatically on button click

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :SharePoint

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 
 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 (w

View Complete Post

More Related Resource Links

Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




Programmatically create an InfoPath form


I'm programmatically creating an InfoPath form using this article: http://www.bizsupportonline.net/infopath2007/programmatically-create-infopath-form-console-app.htm.


Everything works well up to 29 fields (my:field1 ... my:field29). After that it runs without an error and posts a form to the library however the icon does not switch to an infopath icon and the filename stays blanks. I don't believe this field specific, it seems to be happening when I use any 29 to 30 fields so I'm thinking its a memory issue with the stream reader.

Has anybody every had this issue before, is there a way to fix this?


Infopath 2007 print view in browser enabled form with Print button


Hi i create a  print view brower enabled form in Infopath 2007 with header and footer. In Infopath works fine. Margin was ok, header and footter to. But then i try to print this browser the margin, header and footer it changes to default setting of browser ? I try also create a print button in form with VS 2008 code, but method :

this.print(); not working.

It is possible to print the "print view" in browser as the same like in Infopath 2007? Does anyone have the code how to create a print button in C# on browser enabled form?

Infopath button click event in custom workflow code.


Hi All,

I have designed the infopath form(Init) and integrated with my state machine workflow. i want to access button click event (designed in Infopath form) in my workflow code.

Can you help me.




click a button to print current window form

how can i click a button to print current window form? i don't know how to set and define something? anyone give me example for my reference   thanks.

OK button click on Windows dialogue form not triggering click event

I have created an Add-In for Outlook 2003 in Visual Studio 2005. When a new message is sent and a toggle button is selected, a form that I have created will be displayed as a dialogue box, where further information can be entered. Once this information has been entered you can click the OK button and the message is sent. If you were to click the OK button with invalid data in the form, there would be a message box with an error message. This all works perfectly on my development machine but when I have packaged the Add-In and installed it on other machines it does not work. Clicking on the OK button does nothing, there is not even an error message. All the prerequsits are successfully installed and this is the only part of the Add-In that does not work. All help greatly appreciated. Thanks Nick

How to redirect infopath form in web browser

Hi,     Am working in Infopath 2007, i published my Infopath form to a form library, currently am opening my form using Web browser. I want to redirect my form after submitting form to library, Is it possible to redirect the infopath form?, How. If possible is this redirect will support in web browser?

Open another Form from my Main form using a button click


Hi All


I have seen this question asked and answered several times but it doesn't seem to be the question. I have.


I have just created a new project I renamed form1 to FrmMain and then I created a new form by clicking add new form and I named it Report


I then went to my FrmMain and dropped a button on there from the toobox. I now need to open Report.cs when I click the button.


I have tried               Report Form2 = new Report();



But all that does it open a new FORM and its not my Report Form. It also just keeps opening new forms every time I click the button. My thought is that the user will enter a ID then click the button then the report form will open and I will then create a query to populate a data gride or view using the ID form the text box on FrmMain.


Please help.... I am new to this so shoot it straight as if this was your first forms application that you created.



Infopath 2010 Displaying datas from SQL SERVER 2008 with a button click



This is my second post. I am really new to infopath 2010, and need some help.

To display database information on the form, normally you drag the whole datafields to the form.

Then the form will auto generate the header row and data columns. When you PREVIEW the form,

the datas from the server will automatically be binded to the form.


My question is, is there a way not to auto bind the data when the form is loaded, and when the user

clicks a button on the form then this datas display on the form dynamically.

Really appreciate your help,

and since I am a newbie please instruct me with step by step, every details please.


-Wook Tae Jung (Mister Car Wash Inc) 


Infopath 2010 Form design with Optional Section and Option Button


I need help or a push in the right direction. I am creating new forms for sharepoint2010 using infopath2010. Trying to make it so if someone hits an option button it activates an optional section or something simular. basicly if someone answers yes I have more questions for them and dont want them to show UNLESS they say yes.

as always please and thank you

how can i load a window1.xaml form from click event fuction of a button

how can i load a window1.xaml form from click event fuction of a button

have problem to redirect page , on cancel button click



i am doing simple login page and i used to required field validator to validate user name and password text box.

and there are two buttons submit and cancel.

now i want to redirect this page to home.aspx after clicking on cancel button, but that two required fields validator get pop up and i get stuck in login page.

 if anyone knows how to solve this problem please tell me..

thanks, in advance for your valuable time. 

enable a button control on an InfoPath form based on another button control



is it possible to enable a button control based on another button control. so when a user click on a button it enable another button. only if the first button is clicked the second button can be click aswell


Programmatically Mapping Custom SharePoint Column on Non-browser Enabled InfoPath Form


I have an InfoPath form, which, due to control requirements, is not browser enabled. It is being programmatically added as a content type to SharePoint (MOSS 2007). All users have Office 2007 installed so they will be able to open the form. I also have a custom multi-line column in the SharePoint document library. I can manually publish the form and map the column to a field of the form, but I need to be able to do this programmatically.

We are currently deploying the forms by modifying the publish url in the xsf during install. We have tried to modify the site coulmn GUID in the template xsf during install without success.

Does anyone have any ideas as to how we can programmatically promote the InfoPath field so it is visible in SharePoint?

Retrieve the list ID of a programmatically-submitted infopath form

I'm using the DataConnections["SUBMIT"].Execute() method to submit my InfoPath form to a document library.  However, later in the custom code I need to reference back to the submitted form (I need the ID and the title).  Is there a way to gather this information while submitting?

upload multiple files from a single upload button i infopath form


Hi all

        My Infopath form contains an image upload button . Is it possible to upload multiple files at a time from the same upload button.




How to Click a Button in another Application Programmatically in C#?


I would like to invoke the button click event from one application to another application. Is there any to way to trigger the other application events from the main application. Please help.


Thanks in advance.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend