or
Greetings,
I am currently using version control RadAjaxManager 2010.3.1109.35 with the following problem:
I want to update a particular "asp: DropDownList" when the values of a "Telerik:RadMaskedTextBox" changed.
For this purpose i’m using the client event "OnValueChanged" to trigger a Ajax request, however, this scenario only works one time.
After the first ajax request, if i trigger the "OnValueChanged" again, the ajax request isn’t fired. I have done some debug and in the second time i trigger the event, the control RadAjaxManager in the client side is null.
How do I solve this problem?
Code executed in server side:
protected void Adabas_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) { string argument = (e.Argument); string[] arrayString = argument.Split(",".ToCharArray()); string operacao = arrayString[0]; if (operacao == "CarregarADABAS") { ptin.formare.lms.core.utilizadores.cnpj.gestaoCNPJ _gestcnpj = new ptin.formare.lms.core.utilizadores.cnpj.gestaoCNPJ("LMS_BD"); DataTable lista_ADABAS = _gestcnpj.ListaADABASPorCNPJ(arrayString[1]); ddAdabas.Items.Clear(); ddAdabas.DataSource = lista_ADABAS; ddAdabas.DataTextField = "ADABAS"; ddAdabas.DataValueField = "ADABAS"; ddAdabas.DataBind(); } } Code executed in cliente side:
<telerik:RadAjaxManager ID="Adabas" runat="server" onajaxrequest="Adabas_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="Adabas"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="ddAdabas" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function CarregaListaADABAS (sender, args) { var message = args.get_newValue(); message = message.replace(/[^a-zA-Z 0-9]+/g,''); var ajaxManager = $find("<%= Adabas.ClientID %>"); //This value is null in the second time (event OnValueChanged) if(ajaxManager != null) { ajaxManager.ajaxRequest('CarregarADABAS,'+ message); } } </script > </telerik:RadCodeBlock> <Telerik:RadMaskedTextBox ID="txt_cnpj" runat="server" Rows="1" UseEmbeddedScripts="False" Mask="##.###.###/####-##" TextWithLiterals="..-" CausesValidation="True" Width="125px" Height="11px" Skin="Outlook"> <ClientEvents OnValueChanged="CarregaListaADABAS"/> </Telerik:RadMaskedTextBox>
Regards
<telerik:RadRotator ID="rotator1" runat="server" BorderWidth="0" RotatorType="CoverFlowButtons" Width="100%" ItemWidth="64" Height="80px" ItemHeight="64" ScrollDuration="500" FrameDuration="2000" EnableRandomOrder="true" PauseOnMouseOver="false" Skin="Windows7" ScrollDirection="Left, Right" OnClientItemShown="OnClientItemShown" CssClass="RemoveRotatorBorder"> <ItemTemplate> <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Url") %>' AlternateText='<%# Eval("Name") %>' /> </ItemTemplate> </telerik:RadRotator>Telerik.Web.UI.RadRotatorAnimation.set_scrollAnimationOptions("<%= rotator1.ClientID %>", { xR: 5, // The offset in pixels between the selected items and the first item on the left and on the right of the selected item. xItemSpacing: 20, matrix: { m11: 1, m12: 0, m21: -0.1, m22: 1 }, // The 2d transformation matrix, applied to the items that appear on the right of the selected item reflectionHeight: 0.5, // The height of the reflection reflectionOpacity: 1 // The opacity, applied to the reflection } );
var radAjaxMgr = $find('<%= PageRadAjaxManager.clientID %>'); radAjaxMgr.ajaxRequestWithTarget('<%= NotesGrid.clientID %>', ''); $find('<%= PageRadAjaxManager.clientID %>').ajaxRequest('Note');Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page) AddHandler manager.AjaxRequest, AddressOf PalNoteTaskListAjaxManager_AjaxRequest PageRadAjaxManager.AjaxSettings.AddAjaxSetting(manager, TaskGrid, lpWait)Protected Sub PalNoteTaskListAjaxManager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Select Case e.Argument Case "Task" PopulateTaskGrid(False) Case "CompTask" PopulateCompletedTaskGrid(False) Case "Note" FillNoteGrid(False) End Select End Sub<telerik:RadAjaxLoadingPanel id="lpWait" InitialDelayTime="0" runat="server" Transparency="10" Height="100%" Width="100%" > <table Height="200px" Width="100%" > <tr valign="middle" > <td align="center"> <img src="/SI/Images/status_anim.gif" title="Wait" /> </td> </tr> </table> </telerik:RadAjaxLoadingPanel>