This is a migrated thread and some comments may be shown as answers.

Problems recieving results from service

3 Answers 76 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 06 Oct 2010, 04:18 AM
I'm new to using WCF and LINQ. I'm attempting to shoehorn the example from this link:

http://demos.telerik.com/aspnet-ajax/combobox/examples/loadondemand/wcf/defaultcs.aspx

into an application Im putting together as a learning excercise.

Ive verified ( using a packet sniffer, and decoding the HTTP traffic) that the results from the services calls are being sent from the server to the client, however the results do not appear in the combobox.

The svc file looks like:

using

 

 

System;

 

 

using

 

 

System.Collections.Generic;

 

 

using

 

 

System.Data.Linq;

 

 

using

 

 

System.Linq;

 

 

using

 

 

System.Runtime.Serialization;

 

 

using

 

 

System.ServiceModel;

 

 

using

 

 

System.ServiceModel.Activation;

 

 

using

 

 

System.ServiceModel.Web;

 

 

using

 

 

System.Text;

 

 

using

 

 

System.Web.Services;

 

 

using

 

 

Telerik.Web.UI;

 

 

namespace

 

 

QUARK.webservices

 

{

[

 

 

ServiceContract(Namespace = "")]

 

[

 

 

AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

 

 

 

 

public class strange

 

 

{

[

 

OperationContract]

 

 

 

 

public RadComboBoxData LoadDataTemplates(RadComboBoxContext context)

 

{

 

 

 

RadComboBoxData result = new RadComboBoxData();

 

 

 

 

quarkDataContext quarkdb = new quarkDataContext();

 

 

 

 

var allTemplates = from DEVICE_TYPE in quarkdb.DEVICE_TYPEs

 

 

 

 

orderby DEVICE_TYPE.DESC

 

 

 

 

select new RadComboBoxItemData

 

 

{

Text = DEVICE_TYPE.DESC

};

 

 

string text = context.Text;

 

 

 

 

if (!String.IsNullOrEmpty(text))

 

{

allTemplates = allTemplates.Where(item => item.Text.StartsWith(text));

}

 

 

 

int numberOfItems = context.NumberOfItems;

 

 

 

 

var templates2 = allTemplates.Skip(numberOfItems).Take(10);

 

result.Items = templates2.ToArray();

 

 

 

int endOffset = numberOfItems + templates2.Count();

 

 

 

 

int totalCount = allTemplates.Count();

 

 

 

 

if (endOffset == totalCount)

 

result.EndOfItems =

 

 

true;

 

result.Message =

 

 

String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>",

 

endOffset, totalCount);

 

 

 

return result;

 

}

}

}

 



and my combobox in the aspx looks like:

<

 

 

telerik:RadComboBox ID="drp_hosttemplate" Runat="server"

 

 

 

 

Skin="Web20" Width="177px" EnableLoadOnDemand="True"

 

 

 

 

EnableVirtualScrolling="True" ShowMoreResultsBox="True"

 

 

 

 

EnableItemCaching="True" >

 

 

 

 

<WebServiceSettings Method="LoadDataTemplates" Path="webservices/strange.svc" />

 

 

 

 

<ExpandAnimation Type="InOutElastic" />

 

 

 

 

<CollapseAnimation Type="InOutElastic" />

 

 

 

 

</telerik:RadComboBox>

 

 



3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 06 Oct 2010, 11:16 AM
Hello Joe,

Our demo works as expected and your code looks OK.

Could you please provide a live URL to simple page that shows the issue?

Regards,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joe
Top achievements
Rank 1
answered on 06 Oct 2010, 03:06 PM

Unfortunetly, no i dont have a way to publish it for you to view it.

I did notice that when I attempt to access it from the server itself, the browser (ie) says there is an error on the page:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Wed, 6 Oct 2010 14:00:16 UTC

Message: 'length' is null or not an object
Line: 5587
Char: 13
Code: 0


Also, if its any help, here is what I see in the sniffer (my apologies for the format):
.$...f.0 Hs....E.
 ..v.@... ...P...P
 ...P...k ..:..HP.
 ...6..HT TP/1.1 2
 00 OK..C ache-Con
 trol: pr ivate..C
 ontent-L ength: 1
 546..Con tent-Typ
 e: appli cation/j
 son; cha rset=utf
 -8..Serv er: Micr
 osoft-II S/7.0..X
 -AspNet- Version:
  4.0.303 19..X-Po
 wered-By : ASP.NE
 T..Date:  Wed, 06
  Oct 201 0 02:57:
 25 GMT.. ..{"d":{
 "__type" :"RadCom
 boBoxDat a:#Teler
 ik.Web.U I","_con
 text":[] ,"_endOf
 Items":f alse,"_i
 tems":[{ "__type"
 :"RadCom boBoxIte
 mData:#T elerik.W
 eb.UI"," _attribu
 tes":[], "_enable
 d":true, "_text":
 "Access  Switches
                 "
 ,"_value ":""},{"
 __type": "RadComb
 oBoxItem Data:#Te
 lerik.We b.UI","_
 attribut es":[],"
 _enabled ":true,"
 _text":" Access-L
 ist 5 De vices  
       ", "_value"
 :""},{"_ _type":"
 RadCombo BoxItemD
 ata:#Tel erik.Web
 .UI","_a ttribute
 s":[],"_ enabled"
 :true,"_ text":"A
 ggregate  Switche
 s             ","
 _value": ""},{"__
 type":"R adComboB
 oxItemDa ta:#Tele
 rik.Web. UI","_at
 tributes ":[],"_e
 nabled": true,"_t
 ext":"Al l Device
 s               
     ","_ value":"
 "},{"__t ype":"Ra
 dComboBo xItemDat
 a:#Teler ik.Web.U
 I","_att ributes"
 :[],"_en abled":t
 rue,"_te xt":"BGP
  Devices        
             ","_v
 alue":"" },{"__ty
 pe":"Rad ComboBox
 ItemData :#Teleri
 k.Web.UI ","_attr
 ibutes": [],"_ena
 bled":tr ue,"_tex
 t":"Fire walls  
                 
   ","_va lue":""}
 ,{"__typ e":"RadC
 omboBoxI temData:
 #Telerik .Web.UI"
 ,"_attri butes":[
 ],"_enab led":tru
 e,"_text ":"Gatew
 ay\/Edge  Routers
            ","_va
 lue":""} ,{"__typ
 e":"RadC omboBoxI
 temData: #Telerik
 .Web.UI" ,"_attri
 butes":[ ],"_enab
 led":tru e,"_text
 ":"Servi ce Switc
 hes             
  ","_val ue":""},
 {"__type ":"RadCo
 mboBoxIt emData:#
 Telerik. Web.UI",
 "_attrib utes":[]
 ,"_enabl ed":true
 ,"_text" :"Termin
 al Serve rs     
          ","_valu
 e":""},{ "__type"
 :"RadCom boBoxIte
 mData:#T elerik.W
 eb.UI"," _attribu
 tes":[], "_enable
 d":true, "_text":
 "Transpo rt Switc
 hes             "
 ,"_value ":""}],"
 _message ":"Items
  <b>1<\/ b>-<b>10
 <\/b> ou t of <b>
 12<\/b>" ,"_numbe
 rOfItems ":0,"_te
 xt":""," _value":
 ""}}            

I understand if this cant be troubleshot without access to the page.

0
Simon
Telerik team
answered on 12 Oct 2010, 09:59 AM
Hello Joe,

Thank you for the additional info.

The "'length' is null or not an object" issue has been resolved in Q2 2010. Which version of Telerik.Web.UI are you using?

Sincerely yours,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Joe
Top achievements
Rank 1
Answers by
Simon
Telerik team
Joe
Top achievements
Rank 1
Share this question
or