on a dropdown -comboCurrencies, I attach to client event SelectionChanged.
on javascript I change items of another dropdown -comboPremium.
The user chooses another item on comboCurrencies.
on debugging, after the javascript fires, I notice that I reach to the Page_load.
I dont want the JS. to cause me to get to the server function.
Why does this happen?
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;
using System.Data;
using Infragistics.Web.UI.EditorControls;using Infragistics.Web.UI.GridControls;
namespace OptionPricer{ public partial class Pricer : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) { } }}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Pricer.aspx.cs" Inherits="OptionPricer.Pricer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.EditorControls" TagPrefix="ig" %><%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.ListControls" TagPrefix="ig" %><%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI" TagPrefix="ig1" %><%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %><%@ Register Assembly="Infragistics4.Web.v12.2, Version=12.2.20122.2054, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.LayoutControls" TagPrefix="ig" %><html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server"><title></title> <script type="text/javascript"> function ComboCurrenciesChanged() { var comboPrem = $find("comboPremium"); comboPrem._elements["List"].innerHtml = ''; comboPrem.loadItems('ILS', false); } </script></head><body> <form id="form1" runat="server"> <ig1:WebScriptManager ID="WebScriptManager1" runat="server"> </ig1:WebScriptManager> <ig:WebDropDown ID="comboCurrencies" ClientIDMode="Static" runat="server"> <ClientEvents SelectionChanged="ComboCurrenciesChanged" /> <Items> <ig:DropDownItem Key="USD-ILS" Selected="False" Text="USD-ILS" Value="USD-ILS"> </ig:DropDownItem> <ig:DropDownItem Key="EUR-USD" Selected="False" Text="EUR-USD" Value="EUR-USD"> </ig:DropDownItem> </Items> </ig:WebDropDown> <ig:WebDropDown ID="comboPremium" runat="server" ClientIDMode="Static"> </ig:WebDropDown> </form></body></html>
Hello drpoalim,Thank you for posting in our community. Please take a look in our documentation:http://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0?page=WebDropDown~Infragistics.Web.UI.WebDropDown~loadItems.htmlhttp://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0?page=WebDropDown_Lazy_Loading.html Whn you call loadItems on the client ItemsRequested server-side is fired to load the items. This is the architectutre of the control. This is a client-server control. If you want to use a dropdown as a pure javaqscript control I would advice you to use our igCombo. Please take a look at a live sample of it and a documentation:http://es.infragistics.com/products/jquery/sample/combo-box/selection-and-checkboxes http://help.infragistics.com/jQuery/2012.2/ui.igcomboPlease let me know if you have further questions.
Hello drpoalim,Please let me know if you have any further questions.