who to open new form in .NET with parameters

  • Thread starter Flemming Christensen
  • Start date
F

Flemming Christensen

Hi

I have to scenarios where I need to open a new form and transfer data to the
new form using VB.NET code

1. I have a startup form containing buttons. When click'ed I need to startup
a new form (no parameters needed)

2. I get to a new page with a repated table.

I need to add a button to each row in the repeated table, and when clicked
on I need to open a new form and transfer data to it based on info in the
row where the button is located.

Does anyone have some ideas how to do his in either vb.net or c#.net ?
I know I can open a new form with rules in infopath, but I would like to
know how´it can be done i .net.

Thanks in advance

Flemming
 
G

G. Tarazi

I had this problem last year, and no matter what they will tell you in this
message board, passing parameters to an InfoPath from directly is not
possible.



But there is couple of workarounds, the simplest of them is passing the
parameters as part of an empty xml, this is what I am using in all of my
forms.



The idea is simple, as part of the form schema (data structure), create
nodes that you will store the parameters (Imagine hidden text boxes, they
have their place in the schema, they are just not in the view), and then
when you open the new from, either pass the xml file after the form name, or
use the .NET clr to populate the dom of the next form with the xml that has
the parameters.



Both of them require a lot of coding, debugging, and time wasted, until you
get use to it, and then it becomes simple, just copy and paste.



That's why I am still naming that product "Do less with more ;-)" InfoPath
 
F

Flemming Christensen

Thanks!

What I ended up doing was to add code on the button click event. it creates
a text file with the key to use and then starts the next form which in turn
looks for the file, reads the key and deletes the file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top