locked
Passing multiple values using a Pagefunction RRS feed

  • Question

  • Hi Guys,

    Does anyone know how to pass MULTIPLE values using a Pagefunction? There are lots of examples for returning a single value, but I need to return multiple values. 

    Any help would be greatly appreciated.

    Thanks,

    Stephane Touya 
    Sunday, October 26, 2008 4:31 AM

Answers

  • Hi Arjun,

    Ok. I am almost there. I am just have problems breaking out the values on the calling page. Can you help me there?

    Thanks,

    Stephane
    • Marked as answer by MrTouya Monday, October 27, 2008 12:29 AM
    Sunday, October 26, 2008 10:53 PM

All replies

  • you could use something like

    x:TypeArguments="sys:Array"

    in pagefunction declaration to return object of an array

    Happy Coding


    Arjun Paudel
    Sunday, October 26, 2008 5:43 AM
  • Good Idea! I will try it and let you know. Thanks,

    Stephane
    Sunday, October 26, 2008 1:00 PM
  • Hi Arjun,

    So Close. I realized that the values I am returning are of two different types. One is an interface type to a third party Engine and the other is enum to the engine type.  I am still stuck.

    Stephane

    Sunday, October 26, 2008 1:20 PM
  • what about x:TypeArguments="sys:Object"

    and something like:

      Dim objVal() As Object = {"werwer", "rwerw", 1}

            Dim xar As System.Array = Array.CreateInstance(GetType(Object()), 1)


            xar.SetValue(objVal, 0)

            OnReturn(New ReturnEventArgs(Of System.Object)(xar))

    Arjun Paudel
    Sunday, October 26, 2008 2:34 PM
  • Hi Arjun,

    Thanks again. Let me try this one out and I will let you know.

    Stephane :-)
    Sunday, October 26, 2008 3:18 PM
  • Hi Arjun,

    Ok. I am almost there. I am just have problems breaking out the values on the calling page. Can you help me there?

    Thanks,

    Stephane
    • Marked as answer by MrTouya Monday, October 27, 2008 12:29 AM
    Sunday, October 26, 2008 10:53 PM
  • Something like that

        Sub SelectProductPageFunction_Returned(ByVal sender As Object, ByVal e As ReturnEventArgs(Of System.Object))
            Dim arr As Array = e.Result
             Dim firststring As String = CType(arr(0)(0), String)
             Dim secondstring As String = CType(arr(0)(1), String)
    ......................................
    ...........................

    Arjun Paudel
    Monday, October 27, 2008 2:36 AM
  • Hi Stephane!

     did it work?
    Arjun Paudel
    Monday, October 27, 2008 6:24 PM