[CLOSED] render dynamic control

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] render dynamic control

    I load information from a control and add to panel , in a precise moment, i need to load more information / more controls . The controls generated after the click of the button, doesn't appear on the screen , the UpdateContent not worked.

    How can I render these controls without reloading the page ?

      protected void Page_Load(object sender, EventArgs e)
        {
            this.hdnQtdOcorrencia.Value = Convert.ToInt32(this.hdnQtdOcorrencia.Value) == 0 ? 10 : this.hdnQtdOcorrencia.Value;
            this.carregarOcorrencias();
    
        }
     
    protected void carregarOcorrencias() { int tamanhoDt = Convert.ToInt32(this.hdnQtdOcorrencia.Value); ocorr.qtdOcorrencia = tamanhoDt; dt = ocorr.buscarOcorrencias(); if (tamanhoDt <= 10) { dtTake = dt.Rows.Cast<DataRow>().OrderByDescending(x => x["OC_ID"]).ToList(); } else { dtTake = dt.Rows.Cast<DataRow>().OrderByDescending(x => x["OC_ID"]).Skip(tamanhoDt - 10).ToList(); } foreach (var row in dtTake) { CONTROLS_ocorrenciasMural c = (CONTROLS_ocorrenciasMural)this.LoadControl("~/CONTROLS/ocorrenciasMural.ascx"); c.setValues(row); Ext.Net.Hyperlink nOcorrencia = (Ext.Net.Hyperlink)c.FindControl("hypVisualizar"); c.ID = "control" + nOcorrencia.Text; this.panelOcorrencias.ContentControls.Add(c); //this.panelOcorrencias.UpdateContent(); } }
     <ext:hidden runat="server" ID="hdnQtdOcorrencia"></ext:hidden>
     <ext:Panel ID="panelOcorrencias"  runat="server" Region="Center" Flex="5" OverflowY="Auto" Border="false" Frame="false" Layout="VBoxLayout">
                                <LayoutConfig>
                                    <ext:VBoxLayoutConfig Align="Center"></ext:VBoxLayoutConfig>
                                </LayoutConfig>
     </ext:Panel>
    <ext:Button runat="server" UI="Primary" Text="Mais Ocorrências" AutoLoadingState="true">                                  
             <Listeners>
                     <Click Handler="App.direct.onClickMaisOcorrencias(#{hdnQtdOcorrencia}.getValue());"></Click>
            </Listeners>
    </ext:Button>

    public void onClickMaisOcorrencias(int qtdOcorrencia) { this.hdnQtdOcorrencia.Value = qtdOcorrencia + 10; this.carregarOcorrencias(); }
    Last edited by Daniil; Sep 11, 2015 at 12:27 PM. Reason: [CLOSED]

Similar Threads

  1. Render Dynamic Control in View
    By ehmdb in forum 3.x Help
    Replies: 1
    Last Post: Jun 17, 2015, 1:02 PM
  2. [CLOSED] User Control Render dynamic value assign issue in page load
    By shaileshsakaria in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 26, 2014, 5:19 PM
  3. Replies: 0
    Last Post: Aug 23, 2013, 11:16 AM
  4. Replies: 1
    Last Post: Apr 25, 2013, 6:02 AM
  5. Dynamic grid does not render in a dynamic panel
    By Wellington Caetano in forum 1.x Help
    Replies: 4
    Last Post: Apr 12, 2011, 9:19 PM

Tags for this Thread

Posting Permissions