本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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 });
}
示例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;
}
示例9: AjaxStartupScript
public void AjaxStartupScript(UpdatePanel control)
{
ScriptManager.RegisterClientScriptBlock(
control,
this.GetType(),
"key",
GetScript(),
true);
}
示例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();
}
示例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;
}
示例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);
}
}
示例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;
}
示例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]);
}
示例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);
}
}