protected void Wizard1_FinishButtonClick( ... )
{
// Initialize a class named XmlFileWriter
XmlFileWriter wrt = XmlFileWriter( );
// Pass arguments in the method call
wrt.saveXmlFile( textBox1, textBox2)
} // click event
// Instance of the XmlFileWriter class
public class XmlFileWriter
{
// Method is strongly typed
public string saveXmlFile( string textBox1, string textBox2 )
{
...
}
} // class
Okay?
The arguments passed in the method call are of type string because they are
text entered into the TextBox controls. The parameters of the saveXmlFile
method are of type string and the return type of the saveXmlFile method is
of type string.
Now here's the problem.
I also need to pass a CheckBoxList with textBox1 and textBox2 in the method
call but I don't know how to type the parameter in the signature of the
method and I don't even think passing the CheckBoxList is even permitted in
this context...
// Pass arguments in the method call
wrt.saveXmlFile( textBox1, textBox2, checkBoxList1)
// What is the method signature and the modifer for checkBox1?
public string saveXmlFile( string textBox1, string textBox2, ... checkBox1)
The saveXmlFile method uses an instance of an XmlFileWriter to write an XML
file and I need the value of the ListItems from checkBoxList1 to populate
the XML file with data.
Clear as mud? :-)
<%= Clinton Gallagher
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2***************@TK2MSFTNGP15.phx.gbl...
Clinton,
It's a little vague what you are trying to do. You are using the
wizard control, but are you looking for a general solution or are you
looking to return specific parameters?
My first guess is to return a key/value pair, which has the name of the
control, as well as the control itself. You can return a type of Control,
which all three derive from.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:OD**************@TK2MSFTNGP11.phx.gbl... I'm using the 2.0 Wizard control which includes three basic control types
in its various steps; TextBox, DropDownList, and CheckBoxList controls.
I'd like to pass the results of the Wizard to a class but I don't
understand how to type the class or pass the arguments to the parameters
of the class when different types are involved.
All I think I need is confirmation and a signature typing the class
definition. While I'm off to read about generics to determine if this is
how I achieve my goal what would your comments be?
<%= Clinton Gallagher