(Bill Gianoukos)
1/24/2003 10:20:00 AM
Hi Dan,
I have to pass the controls on the form. The reason I need to do this
is because their might be from 2 to 50 controls. Sorry for the typo
earlier. I want to be able to write code in the web service that
loops through all of the controls in the web form.
Do you know if microsoft allows for a form to be passed via the soap
protocol.
Regards,
Bill Gianoukos
"Dan" <dan@rpsd.com> wrote in message news:<JaFX9.6775$bL4.676929@newsread2.prod.itd.earthlink.net>...
> Is it necessary to pass the form? It seems it'd be easier to pass only the
> values. You can minimize the number of arguments the function takes by
> creating a structure:
> Public Structure MyStruct
> Public var1 As String
> Public var2 As String
> Public var3 As String
> Public var4 As String
> Public var5 As String
> End Structure
>
> <WebMethod()> Public Function MyFunction(ByRef ms As MyStruct) As String
> With ms
> MyFunction = var1 & var2 & var3 & var4 & var5 ' or whatever
> End with
>
> On the client side, you'd have:
> Dim ws As localhost/Service1
> Dim MyStruct As ws.MyStruct
> MyStruct.var1 = TextBox1.Text
> ' etc.
> TextBox6.Text = ws.MyFunction(MyStruct)
>
> But, as noted in my previous post, this may not be the ideal solution.
>
>
> "Bill Gianoukos" <vgianouk@yahoo.com> wrote in message
> news:9c9ce9b3.0301221429.7092ac41@posting.google.com...
> > Hi Group,
> >
> > I was hoping someone can help me figure out how to create a webmethod
> > that takes as an input parameter a form and all it's controls.
> >
> > What I want to do is create an vb.net aspx page that has 2 - 5
> > questions on it. I want to pass the entire form to a web service when
> > you hit the submit button on the page. I want to web service to
> > return a string when it has finished processing.
> >
> > I have tried declaring the webmethod like:
> >
> > <WebMethod()> Public Function FormPass(ByVal theform As
> > System.Web.UI.ControlCollection) As String
> >
> > but this doesn't compile.
> >
> > Any help would be greatly appreciated.
> >