page 1 of 1
Comments: 3 | Views: 1210
SaraJoRedux
SaraJoRedux
GirlDeveloper.com

Ok, so my method in my webservice requires a type to be passed, it is called in the ServiceMethod property of the AutoCompleteExtender, I am fuzzy about how I should do that so I called it like this:

ServiceMethod="DropDownLoad<<%=(typeof)subCategory%>>"

where subCategory is a page property that looks like this:

protected SubCategory subCategory
    {
        get
        {
            var subCategory =


NHibernateObjectHelper
.LoadDataObject<SubCategory>(Convert.ToInt32(Request.QueryString["SCID"]));
            return subCategory;
        }
    }
jh71283
jh71283
Throw new System.Beverage. OutOfCoffeeException​()
SaraJo not use pretty colors.

 Makes John sad Sad
stevo_
stevo_
Human after all
I'm not sure if the code you pasted was posted correctly? some of it looks a bit confusing.. the ServiceMethod is just a string you need to tell it which method it has to call (presumably in your case - DropDownLoad).

The DropDownLoad method is expected to have a specific signature you cannot (at least that I know of) adapt the parameters that it sends to the service method.. the resolution is simple however, you just need to call a ServiceMethod that returns the specific types you want.. you should also be aware that the service call is being done by the client (which isn't .net), so sending Type as a parameter in a ServiceMethod would either result in serialization, or more likely an exception.. either way sending types as text has a huge potential security risk.
page 1 of 1
Comments: 3 | Views: 1210
Microsoft Communities