mercoledì 24 settembre 2008

How Set Client-Side Selected Value from DropDownList Using the CascadingDropDown

L'altro giorno mi sono imbattuto in questo piccolo problemino...
Beh, non so se questo è il modo corretto .... ma funziona!

    1     // set default value

    2     function setSelectedIndex(_control, _value) {

    3         for ( var i = 0; i < _control.options.length; i++ ) {

    4             if ( _control.options[i].value == _value ) {

    5                 _control.options[i].selected = true;

    6                 return;

    7             }

    8         }

    9     }

   10     // Load Data From DB

   11     function LoadData()

   12     {

   13         GetWebServiceProxy().GetDataFromDB(key, LoadSuccess, LoadFail, key);

   14     }

   15     // Binding Data   

   16     function LoadSuccess(result, userContext, methodName)

   17     {

   18         // set the Parent value   

   19         setSelectedIndex( $get(ddlParent), result.parentValue ); 

   20         // set the Child value

   21         $find("bIDChild").set_contextKey( result.parentValue ); 

   22         $find("bIDChild")._onParentChange( null, false );

   23         $find("bIDChild").set_SelectedValue( result.childValue, result.childValue );

   24     }

   25 

   26     // Raise Error

   27     function LoadFail(result, userContext, methodName)

   28     {

   29         alert('[LoadData] method fail.');

   30     }   

   31 </script>

   32 

   33 <div>

   34     <asp:DropDownList ID="ddlParent" runat="server">

   35     </asp:DropDownList>

   36     <ajaxToolkit:CascadingDropDown ID="cdParent" runat="server" TargetControlID="ddlParent"

   37         Category="Parent" PromptText="Please select an Parent" LoadingText="[Loading Parent...]"

   38         ServicePath="myWebServices.asmx" ServiceMethod="myWebMethod" BehaviorID="bIDParent" />

   39     <asp:DropDownList ID="ddlChild" runat="server">

   40     </asp:DropDownList>

   41     <ajaxToolkit:CascadingDropDown ID="cdChild" runat="server" TargetControlID="ddlChild"

   42         Category="Child" PromptText="Please select an Child" LoadingText="[Loading Child...]"

   43         ServicePath="myWebServices.asmx" ServiceMethod="myWebMethod" BehaviorID="bIDChild"

   44         ParentControlID="ddlParent" />

   45 </div>

7 commenti:

Jessica Escorts Services ha detto...


KOLKATA ESCORTS
KOLKATA ESCORT
ESCORTS SERVICE IN KOLKATA
ESCORT SERVICE KOLKATA
ESCORTS SERVICE
ESCORT SERVICE
ESCORT
ESCORTS
FEMALE ESCORTS SERVICE KOLKATA
KOLKATA FEMALE ESCORTS SERVICE
INDEPENDENT ESCORTS SERVICE
INDEPENDENT ESCOTRTS SERVICE KOLKATA
KOLKATA INDEPENDET ESCORTS SERVICE
RUSSIAN ESCORTS SERVICE KOLKATA
RUSSIAN ESCORTS SERVICE
KOLKATA RUSSIAN ESCORTS SERVICE
FOREIGN ESCORTS SERVICE IN KOLKATA
INDEPENDEN FOREIGN ESCORTS SERVICE

Shruti Modi ha detto...

Website: Surat escorts

Shruti Modi ha detto...

Not one or the other they were so mindful of the ways to show themselves in a bewildering way before their clients. In truth, they never pay consideration to their looks. All they looked for was conveying arousing Surat escorts agency to the clients.


Website: exclusive service escorts Surat
Website: Private independent Escorts in Surat
Website: Hotel girls leak photo escorts surat
Website: In call and out call rate escort surat
Website: Call Girl Number on Whatsapp in Surat

Shruti Modi ha detto...

Website: bangalore escorts
Website: amboli escorts
Website: aurangabad escorts
Website: igatpuri escorts
Website: Surat escorts

Rubby Rathor ha detto...

Be that because it may, by and by the circumstance has changed, directly the universe of escorts is advanced. You don’t need to go wherever, essentially visit the location, choose your daydream young lady and book her for a wistful night.
Book cheap rate call girls in surat at best rates & price!

independent escort in surat
Independent escort in Surat
beautiful photo gallery escorts in surat
most expensive escort in surat
Surat Bhabhi call girls number
gorgeous escort in surat

Rubby Rathor ha detto...

Best call girls escort agency in Haryana! book fast hurry up!

ambala escorts
bhiwani escorts
charkhi dadri escorts
faridabad escorts
gurgaon escorts
hisar escorts

Urmi Shghal ha detto...

Having intercourse with a girl need to be a collectively advisable activity. The girl additionally likes pleasure and orgasm. Surat Call female supply recommendations for enhancing horny time and having exciting in mattress with you. Prepare your accomplice for intercourse by means of being greater bodily and loving at some point of the meeting. These actions want now not to be overstated. Rest your hand on her decrease returned and inform her as she walks or holds her hand. Touch the hair in the back of the ear. Repeated bodily contact will stimulate her senses and make her choose to be extra in touch. Talking about intercourse between men and ladies has to turn out to be more tabooed than having sex. There is no cause you and your accomplice can't talk about what you like in the bedroom. Ask her if there is anything, she needs to strive for with you or any role you continually wanted. You want to hear and internalize the whole thing that she needs to offer. Keep these nuggets of expertise when you go to sleep together. She will be grateful that you took the time to think about her offerings. Surat escorts will reward you for that in return for mutual fantasy.
Surat Escorts Agency | Surat Escorts | Surat Escorts Services