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

viewstate being posted when requestItems called

4 Answers 172 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
CodeR
Top achievements
Rank 2
CodeR asked on 06 Aug 2010, 08:40 AM
Hi,
I am using the latest build (2010.2.713.40) of the RadCombobox.
I have several combos setup which load their items ondemand via the requestItems method.
I am submitting a parameter via this method which affects which items are returned.

here is an example of the executed code

combo.requestItems(

 

"Client"), false);

 


I would imagine that the page's current viewstate is irrelevant as far as the requestItems call goes.
Also the following doco page states that
"Telerik RadComboBox performs a "light" callback to the server - no ViewState information is sent to the server and the Page.IsPostBack property is set to False when the combobox is in a callback mode."
http://www.telerik.com/help/aspnet-ajax/combobox-slow-callback.html

However in my performance profiling via fiddler it appears that the viewstate along with all other form variables are being submitted.
From Fiddler:
Bytes Sent:  10,757
Bytes Received: 1,064

The bytes received is as I would expect but the sent is rather high.
Upon further investigation I found the following being submitted in the POST data, note I have omitted a bunch of non-relevant items that make up the full 10kB.

ctl00_RadScriptManager1_TSM 
__EVENTTARGET 
__EVENTARGUMENT 
__VIEWSTATE /wEPDwUJMjgyMzEyODM5ZBgIBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WJAUUY3RsMDAkRm9ybURlY29yYXRvcjEFFmN0bDAwJGNwaFBhZ2VCb2R5MSRkdGUFImN0bDAwJGNwaFBhZ2VCb2R5MSRfU2hhcmVkQ2FsZW5kYXIFImN0bDAwJGNwaFBhZ2VCb2R5MSRfU2hhcmVkQ2FsZW5kYXIFHWN0bDAwJGNwaFBhZ2VCb2R5MSR0c1R5cGVNZW51BTxjdGwwMCRjcGhQYWdlQm9keTEkdGltZUV4cFByb2plY3QkcnB0UHJvamVjdHMkY3RsMDAkZHRlRmlyc3QFRWN0bDAwJGNwaFBhZ2VCb2R5MSR0aW1lRXhwUHJvamVjdCRycHRQcm9qZWN0cyRjdGwwMCRkdGVGaXJzdCRjYWxlbmRhcgVFY3RsMDAkY3BoUGFnZUJvZHkxJH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BQwqIFVuYXNzaWduZWRlZDRJCMVPR9RwQeFFerRFT57tpozNQftYdSxJut2bZwfA
__SCROLLPOSITIONX 0
__SCROLLPOSITIONY 0
ctl00$cphPageBody1$rcClient * Unassigned
ctl00_cphPageBody1_rcClient_ClientState 
__CALLBACKID ctl00$cphPageBody1$rcClient
__CALLBACKPARAM {"Command":"LOD","Text":"*%20Unassigned","ClientState":{"value":"","text":"* Unassigned","enabled":true,"logEntries":[]},"Context":{"Text":"* Unassigned","NumberOfItems":0},"NumberOfItems":0}

Am i loading the items incorrectly? or is the viewstate required?
I am trying to optimise my app to run as quickly as possible. By reducing the bytes uploaded to 1kB or less would be a huge improvement.

Thanks Telerik or anyone who is able to assist
Damien

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 06 Aug 2010, 01:30 PM
Hello Damien Coyle,

Thank you for your note.

Indeed our documentation is wrong - ViewState is transmitted back to the server. This is a 'feature' of the ASP.NET AJAX Framework and our controls are based on it. We will update the documentation to reflect this.

Now if you want to achieve the best Load On Demand performance I suggest you use a Web Service. Please see this demo for more information and sample code.

Greetings,
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
CodeR
Top achievements
Rank 2
answered on 09 Aug 2010, 02:55 AM
Simon,
Thanks for the reply.
I am now attempting to change my code to make use of a WCF enabled web service as per your doco.
The viewstate is not being sent but I am still having issues.

Basically when I debug with fiddler I can see the context info being sent
{"context":[{"Key":"Text","Value":"* Unassigned"},{"Key":"NumberOfItems","Value":0}]}

But when I debug the web service the RadComboBoxContext is always set to Nothing. The only difference that I can see with my code and yours is that mine is in VB.NET. I am contemplating rewriting in C# and testing. Is there anything obvious that I have missed?

Thanks

Below is my web.config

 

 

 

<system.serviceModel>
       <behaviors>
           <endpointBehaviors>
               <behavior name="WSComboHelperAspNetAjaxBehavior">
                   <enableWebScript />
               </behavior>
           </endpointBehaviors>
           <serviceBehaviors>
               <behavior name="WSComboHelperAspNetAjaxBehavior" >
                   <serviceMetadata httpGetEnabled="true" />
               </behavior>
           </serviceBehaviors>
       </behaviors>
       <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
         multipleSiteBindingsEnabled="true" />
       <services>
           <service name="WSComboHelper" behaviorConfiguration="WSComboHelperAspNetAjaxBehavior">
               <endpoint address="" behaviorConfiguration="WSComboHelperAspNetAjaxBehavior"
                 binding="webHttpBinding" contract="WSComboHelper" />
           </service>
       </services>
   </system.serviceModel>

and here is the start of my service
<ServiceContract(Namespace:="")>
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
Public Class WSComboHelper
  
    <OperationContract()>
    Public Function GetClientData(ByVal ContextBoundObject As RadComboBoxContext) As RadComboBoxData

and my combobox definition
<telerik:RadComboBox OnClientLoad="ClientReady" ID="rcClient" runat="server" AllowCustomText="false" EnableItemCaching="true" OnClientDropDownOpened="ComboOpen"
           EnableLoadOnDemand="true" OnClientDropDownClosed="ClientSelected" OnClientItemsRequested="ItemsReturned"  OnClientItemsRequesting="ItemsRequesting"
           MarkFirstMatch="false" Text="* Unassigned" Width="100%" Height="200px">
                       <WebServiceSettings Method="GetClientData" Path="WSComboHelper.svc" />   
           </telerik:RadComboBox>

0
CodeR
Top achievements
Rank 2
answered on 09 Aug 2010, 03:10 AM
Simon,
I just quickly knocked up a mockup implementation in C# and can confirm that the RadcomboboxContext parameter is now correctly being passed. Is this why there aren't any VB.NET examples of the WCF service?

Damien
0
Accepted
Simon
Telerik team
answered on 11 Aug 2010, 01:21 PM
Hi Damien Coyle,

The code of the VB version of the WCF service works fine, however is at the bottom of the ComboBoxWcfService.cs file, so you need to scroll a little bit to locate the code. I justed tested the Context object and it was OK.

We will update the demo to include a separate file for the VB version. Thank you for discovering this and letting us know.

Best wishes,
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
CodeR
Top achievements
Rank 2
Answers by
Simon
Telerik team
CodeR
Top achievements
Rank 2
Share this question
or