On my first form I only had one data source (Main)
and used the following code to set my file name prior to a save
meetingName = XDocument.DOM.selectSingleNode( "//my:field1" ).text;
meetingDate = XDocument.DOM.selectSingleNode( "//my:field2" ).text;
XDocument.UI.SetSaveAsDialogFileName(meetingDate + " - " +
meetingName);
Very simple...
Now on a new form I've got two data sources, again the field I'm trying
to use is simply a text box on the main form, but I just cannot get the
syntax correct. Name of the field is "UseCaseName"
I've tried:
docName = XDocument.DOM.selectSingleNode( "//my:UseCaseName" ).text;
I've tried it many different ways but simply cannot reference it, if I
navigate to it using the expression control that field is shown as
"my:UseCaseName"
But everytime I run this I get that the object cannot be found.
Please help, I know it is something ridiculously simple...
Thanks.
S.Y.M. Wong-A-Ton - 22 Nov 2006 06:57 GMT
It is not a simple question if the structure of your form is unknown to
others. :)
Try saving your form (fill it out and save it as XML), download a tool
called "Visual XPath" (see
http://weblogs.asp.net/nleghari/articles/27951.aspx), load the XML for your
form in it, and type in and try finding the correct XPath to the XML node you
require.
Did you already try the full XPath expression to the node? That is,
"/my:myFields/..."?
---
S.Y.M. Wong-A-Ton
> On my first form I only had one data source (Main)
> and used the following code to set my file name prior to a save
[quoted text clipped - 23 lines]
>
> Thanks.