当前位置: 首页>>代码示例>>C#>>正文


C# UI.UpdatePanel类代码示例

本文整理汇总了C#中System.Web.UI.UpdatePanel的典型用法代码示例。如果您正苦于以下问题:C# UpdatePanel类的具体用法?C# UpdatePanel怎么用?C# UpdatePanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UpdatePanel类属于System.Web.UI命名空间,在下文中一共展示了UpdatePanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateChildControls

        protected override void CreateChildControls() {
            base.CreateChildControls();

            Control parent;
            Control container;

            // Get a reference to the ScriptManager object for the page
            // if one exists.
            ScriptManager sm = ScriptManager.GetCurrent(Page);

            if (sm == null || !sm.EnablePartialRendering)
            {
                // If partial rendering is not enabled, set the parent
                // and container as a basic control. 
                container = new Control();
                parent = container;
            }
            else
            {
                // If partial rendering is enabled, set the parent as
                // a new UpdatePanel object and the container to the 
                // content template of the UpdatePanel object.
                UpdatePanel up = new UpdatePanel();
                container = up.ContentTemplateContainer;
                parent = up;
            }

            AddDataboundControls(container);

            Controls.Add(parent);
        }
开发者ID:nobled,项目名称:mono,代码行数:31,代码来源:ProductsView.cs

示例2: AddUpdatePanel

        private void AddUpdatePanel(Panel p)
        {
            this.messageLabel = new Label();

            this.updatePanel = new UpdatePanel();
            this.updatePanel.ID = "ScrudUpdatePanel";
            this.updatePanel.ChildrenAsTriggers = true;
            this.updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.topCommandPanel.GetCommandPanel("top"));
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.messageLabel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.gridPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.formPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.bottomCommandPanel.GetCommandPanel("bottom"));

            //Bottom command panel.
            this.userIdHidden = new HiddenField();
            this.userIdHidden.ID = "UserIdHidden";
            this.userIdHidden.Value = this.UserId.ToString(CultureInfo.InvariantCulture);

            this.officeCodeHidden = new HiddenField();
            this.officeCodeHidden.ID = "OfficeCodeHidden";
            this.officeCodeHidden.Value = this.OfficeCode;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.userIdHidden);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.officeCodeHidden);
            p.Controls.Add(this.updatePanel);
        }
开发者ID:JonathanValle,项目名称:mixerp,代码行数:28,代码来源:UpdatePanel.cs

示例3: UpdateToolTip

 private void UpdateToolTip(string elementID, UpdatePanel panel)
 {
     Control ctrl = Page.LoadControl("SampleControl1.ascx");
     panel.ContentTemplateContainer.Controls.Add(ctrl);
     SampleControl1 details = (SampleControl1)ctrl;
     details.ProductID = elementID;
 }
开发者ID:vaibhavgeek,项目名称:friendyoke,代码行数:7,代码来源:SampleMenu1.aspx.cs

示例4: CreateChildControls

        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls 
        /// that use composition-based implementation to create any child controls
        /// they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            m_MainPanel = new UpdatePanel();
            m_MainPanel.RenderMode = UpdatePanelRenderMode.Inline;

            // The next two lines ensure that nothing is sent to the client,
            // as there's no information to send anyway. This reduces overhead.
            m_MainPanel.UpdateMode = UpdatePanelUpdateMode.Conditional;
            m_MainPanel.ChildrenAsTriggers = false;

            Controls.Add(m_MainPanel);

            m_TypeBox = new TextBox();
            m_TypeBox.ID = "Type";
            m_TypeBox.EnableViewState = false;
            m_TypeBox.ValidationGroup = "Communicator";
            m_MainPanel.ContentTemplateContainer.Controls.Add(m_TypeBox);

            m_MessageBox = new TextBox();
            m_MessageBox.ID = "Message";
            m_MessageBox.EnableViewState = false;
            m_MessageBox.ValidationGroup = "Communicator";
            m_MainPanel.ContentTemplateContainer.Controls.Add(m_MessageBox);

            m_SubmitButton = new Button();
            m_SubmitButton.ID = "Submit";
            m_MessageBox.EnableViewState = false;
            m_SubmitButton.ValidationGroup = "Communicator";
            m_SubmitButton.Click += new EventHandler(SubmitButton_Click);
            m_MainPanel.ContentTemplateContainer.Controls.Add(m_SubmitButton);

        }
开发者ID:ChrisNikkel,项目名称:Umbraco-CMS,代码行数:39,代码来源:Communicator.cs

示例5: CreateChildControls

        // Events /////////////////////////////////////////////////////////
        protected override void CreateChildControls()
        {
            Controls.Clear();
            UIControls.ErrorMessage.Text = string.Empty;

            _masterUpdatePanel = new UpdatePanel();
            _masterUpdatePanel.ID = "ImportExportUpdatePanel";
            _masterUpdatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;

            _masterUpdatePanel.ContentTemplateContainer.Controls.Clear();

            switch (PortletMode)
            {
                case ImportExportPortletState.Import:
                    CreateImportControls();
                    SetImportPostBackButton();
                    break;
                case ImportExportPortletState.Export:
                    CreateExportControls();
                    break;
                default:
                    CreateImportControls();
                    SetImportPostBackButton();
                    CreateExportControls();
                    CreateToolbar();
                    break;
            }


            Controls.Add(_masterUpdatePanel);

            ChildControlsCreated = true;
        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:34,代码来源:ImportExportPortlet.cs

示例6: CreateChildControls

        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Control parent;
            Control container;

            UpdatePanel up = new UpdatePanel();
            container = up.ContentTemplateContainer;
            parent = up;

            //Doctype picker
            picker = (DropDownList)new DocTypePicker().RenderControl();
            picker.AutoPostBack = true;
            picker.SelectedIndexChanged += new EventHandler(picker_SelectedIndexChanged);
            picker.ID = "doctypepicker";

            locationPicker.ID = "locationpicker";
            locationPicker.AutoPostBack = true;

            p_items.CssClass = "docMapper";
            p_items.Visible = false;

            container.Controls.Add(picker);
            container.Controls.Add(p_items);
            container.Controls.Add(locationPicker);
            Controls.Add(parent);
        }
开发者ID:TimGeyssens,项目名称:LocatorRazorStyle,代码行数:28,代码来源:DocumentMapperControl.cs

示例7: RegisterUpdatePanel

 protected void RegisterUpdatePanel(UpdatePanel panel)
 {
     var sType = typeof(ScriptManager);
     var mInfo = sType.GetMethod("System.Web.UI.IScriptManagerInternal.RegisterUpdatePanel", BindingFlags.NonPublic | BindingFlags.Instance);
     if (mInfo != null)
         mInfo.Invoke(ScriptManager.GetCurrent(Page), new object[] { panel });
 }
开发者ID:jupmasalamanca,项目名称:idisa,代码行数:7,代码来源:FrmArchivoCCSS.aspx.cs

示例8: RegisteredDisposeScript

 internal RegisteredDisposeScript(Control control, string disposeScript, UpdatePanel parentUpdatePanel) {
     Debug.Assert(control != null);
     Debug.Assert(disposeScript != null);
     Debug.Assert(parentUpdatePanel != null);
     _control = control;
     _script = disposeScript;
     _parentUpdatePanel = parentUpdatePanel;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:8,代码来源:RegisteredDisposeScript.cs

示例9: AjaxStartupScript

 public void AjaxStartupScript(UpdatePanel control)
 {
     ScriptManager.RegisterClientScriptBlock(
         control,
         this.GetType(),
         "key",
         GetScript(),
         true);
 }
开发者ID:hkiaipc,项目名称:yh,代码行数:9,代码来源:UCDanRi.ascx.cs

示例10: HideAjaxinit

 public void HideAjaxinit(UpdatePanel up)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(" <script language=JavaScript type=text/javascript>");
     sb.Append(" if( document.getElementById('loader_container')) document.getElementById('loader_container').style.display='none';");
     sb.Append("</script>");
     ScriptManager.RegisterClientScriptBlock(up, typeof(UpdatePanel), "Progress", sb.ToString(), false);
     //HttpContext.Current.Response.Flush();
 }
开发者ID:qq5013,项目名称:XJ_WMS,代码行数:9,代码来源:BasePageNoLoading.cs

示例11: CreateUpdatePanel

 public UpdatePanel CreateUpdatePanel(string Prefix, UpdatePanelUpdateMode Upm, int PaneUpdatePanelCount)
 {
     UpdatePanel udp = new UpdatePanel();
     udp.UpdateMode = Upm;
     PaneUpdatePanelCount++;
     udp.ID = "_udp_" + "_" + PaneUpdatePanelCount + Prefix;
     //udp.EnableViewState = true;
     return udp;
 }
开发者ID:electrono,项目名称:veg-web,代码行数:9,代码来源:ctl_Extensions.ascx.cs

示例12: p_Init

 void p_Init(object sender, EventArgs e)
 {
    if(IsInAjaxMode())
    {
        up = new UpdatePanel();
        up.ID = UpdatePanelId;
        up.UpdateMode = UpdatePanelUpdateMode.Always;
        page.Form.Controls.Add(up);
    }
 }
开发者ID:vincentzh,项目名称:nhibernate.burrow-custom,代码行数:10,代码来源:GlobalPlaceHolder.cs

示例13: UpdateToolTip

        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
           
                Control ctrl = Page.LoadControl("~/user-controls/footer.ascx");
                panel.ContentTemplateContainer.Controls.Add(ctrl);
                // ProductDetails details = (ProductDetails)ctrl;
                //details.ProductID = elementID;
            

        }
开发者ID:vaibhavgeek,项目名称:friendyoke,代码行数:10,代码来源:Default.aspx.cs

示例14: AddControlToBody_WithOtherControl_AddsControlToBodyControl

        public void AddControlToBody_WithOtherControl_AddsControlToBodyControl()
        {
            // arrange
            var updatePanel = new UpdatePanel();
            var control = new UserControl();
            var bodyControl = new UserControl();
            var page = new SubtextMasterPage();

            // act
            page.AddControlToBody("Other", control, updatePanel, bodyControl);

            // assert
            Assert.AreEqual(control, bodyControl.Controls[0]);
        }
开发者ID:ChrisPelatari,项目名称:SubText,代码行数:14,代码来源:SubtextMasterPageTests.cs

示例15: AddSPNotification

 public static void AddSPNotification(UpdatePanel updSettings, string text, bool isRefresh)
 {
     if (String.IsNullOrEmpty(text) == false)
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.AppendLine(string.Format("SP.UI.Notify.addNotification(\"{0}\");", text));
         if (isRefresh == true)
         {
             stringBuilder.AppendLine("SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 1);");
             stringBuilder.AppendLine("window.frameElement.commitPopup();");
         }
         ScriptManager.RegisterClientScriptBlock(updSettings, updSettings.GetType(), Guid.NewGuid().ToString(), stringBuilder.ToString(), true);
     }
 }
开发者ID:Fabiarm,项目名称:spsmfiles,代码行数:14,代码来源:Helper.cs


注:本文中的System.Web.UI.UpdatePanel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。