本文整理汇总了C#中IButtonControl类的典型用法代码示例。如果您正苦于以下问题:C# IButtonControl类的具体用法?C# IButtonControl怎么用?C# IButtonControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IButtonControl类属于命名空间,在下文中一共展示了IButtonControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLoad
protected override void OnLoad(EventArgs e)
{
SubmitButton = (IButtonControl)Page.FindControl(this.SubmitButtonID);
SubmitButton.Click += new EventHandler(CreateCustomerButtonClick);
ErrorButton = (IButtonControl)Page.FindControl(this.ErrorButtonID);
ErrorButton.Click += new EventHandler(CustomerErrorButtonClick);
}
示例2: SetPostBackUrl
private static void SetPostBackUrl(IButtonControl button, bool redirectToOriginalPath)
{
if (button == null)
throw new ArgumentNullException("button");
var backUrl = PortalContext.Current.RequestedUri.PathAndQuery;
backUrl = redirectToOriginalPath ? PortalContext.Current.BackUrl : Uri.EscapeDataString(backUrl);
var postBackUrl = String.IsNullOrEmpty(backUrl) ? "/UploadProxy.ashx" : String.Concat("/UploadProxy.ashx", "?back=", backUrl);
button.PostBackUrl = postBackUrl;
}
示例3: OnLoad
protected override void OnLoad(EventArgs e)
{
SubmitButton = (IButtonControl)Page.FindControl(this.SubmitButtonID);
SubmitButton.Click += new EventHandler(SubmitButton_Click);
ErrorButton = (IButtonControl)Page.FindControl(this.ErrorButtonID);
ErrorButton.Click += new EventHandler(ErrorButton_Click);
if (!Page.IsPostBack)
DataBind();
}
示例4: GetCallbackScript
public string GetCallbackScript(IButtonControl buttonControl, string argument)
{
ClientScriptManager cm = Page.ClientScript;
string callBackArg = string.Format("'{0}'", DataSource.ToString());
string js = String.Format("javascript:{0};{1};{2}; return false;",
"__theFormPostData = ''",
"WebForm_InitCallback()",
cm.GetCallbackEventReference(this, callBackArg,
clientCallBackFunctionName, "null"));
return js;
}
示例5: SetCommandName
public void SetCommandName(IButtonControl control, string value)
{
if (value != null)
{
if (!_controlMappings.ContainsKey(control))
RegisterClick(control);
_controlMappings[control] = value;
}
else if (_controlMappings.ContainsKey(control))
{
UnregisterClick(control);
_controlMappings.Remove(control);
}
}
示例6: UpdateDefaultButton
protected override void UpdateDefaultButton()
{
// Find the bottom active control.
ContainerControl c = this;
while (true)
{
ContainerControl nextActive = c.ActiveControl as ContainerControl;
if (nextActive == null)
{
break;
}
c = nextActive;
}
IButtonControl newDefaultButton = c as IButtonControl;
if (c == null)
{
newDefaultButton = acceptButton;
}
if (newDefaultButton != defaultButton)
{
// Notify the previous button that it is not the default.
if (defaultButton != null)
{
defaultButton.NotifyDefault(false);
}
defaultButton = newDefaultButton;
if (defaultButton != null)
{
defaultButton.NotifyDefault(true);
}
}
}
示例7: GetCallbackScript
protected virtual string GetCallbackScript (IButtonControl control, string argument)
{
if (EnableSortingAndPagingCallbacks) {
Page page = Page;
if (page != null)
page.ClientScript.RegisterForEventValidation (UniqueID, argument);
return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + control.CommandName + "$" + control.CommandArgument + "\"); return false;";
} else
return null;
}
示例8: ApplyButtonStyleInternal
protected void ApplyButtonStyleInternal(IButtonControl control, Style buttonStyle) {
WebControl webCtrl = control as WebControl;
if (webCtrl != null) {
webCtrl.ApplyStyle(buttonStyle);
webCtrl.ControlStyle.MergeWith(Owner.NavigationButtonStyle);
}
}
示例9: NavigationTemplate
private NavigationTemplate(Wizard wizard, WizardTemplateType templateType, bool button1CausesValidation,
String label1ID, String label2ID, String label3ID) {
_wizard = wizard;
_button1ID = label1ID;
_button2ID = label2ID;
_button3ID = label3ID;
_templateType = templateType;
_buttons = new IButtonControl[3][];
_buttons[0] = new IButtonControl[3];
_buttons[1] = new IButtonControl[3];
_buttons[2] = new IButtonControl[3];
_button1CausesValidation = button1CausesValidation;
}
示例10: RegisterCommandEvents
protected internal void RegisterCommandEvents (IButtonControl button)
{
button.Command += ProcessCommand;
}
示例11: SetDefaultButton
private void SetDefaultButton(IButtonControl button)
{
IButtonControl control = (IButtonControl) base.Properties.GetObject(PropDefaultButton);
if (control != button)
{
if (control != null)
{
control.NotifyDefault(false);
}
base.Properties.SetObject(PropDefaultButton, button);
if (button != null)
{
button.NotifyDefault(true);
}
}
}
示例12: ApplyButtonProperties
private static void ApplyButtonProperties(IButtonControl button, string text, string imageUrl) {
ApplyButtonProperties(button, text, imageUrl, true);
}
示例13: GetCallbackScript
public string GetCallbackScript(IButtonControl buttonControl, string argument)
{
return Page.ClientScript.GetCallbackEventReference(
this, "", "RefreshPanel", "null");
}
示例14: CreateButtonControl
private void CreateButtonControl(IButtonControl[] buttons, String id, bool causesValidation, string commandName) {
LinkButton linkButton = new LinkButton();
linkButton.CausesValidation = causesValidation;
linkButton.ID = id + "LinkButton";
linkButton.Visible = false;
linkButton.CommandName = commandName;
linkButton.TabIndex = _wizard.TabIndex;
_wizard.RegisterCommandEvents(linkButton);
buttons[0] = linkButton;
ImageButton imageButton = new ImageButton();
imageButton.CausesValidation = causesValidation;
imageButton.ID = id + "ImageButton";
imageButton.Visible = true;
imageButton.CommandName = commandName;
imageButton.TabIndex = _wizard.TabIndex;
_wizard.RegisterCommandEvents(imageButton);
imageButton.PreRender += new EventHandler(OnPreRender);
buttons[1] = imageButton;
Button button = new Button();
button.CausesValidation = causesValidation;
button.ID = id + "Button";
button.Visible = false;
button.CommandName = commandName;
button.TabIndex = _wizard.TabIndex;
_wizard.RegisterCommandEvents(button);
buttons[2] = button;
TableCell tableCell = new TableCell();
tableCell.HorizontalAlign = HorizontalAlign.Right;
_row.Cells.Add(tableCell);
tableCell.Controls.Add(linkButton);
tableCell.Controls.Add(imageButton);
tableCell.Controls.Add(button);
}
示例15: FromEnter
private void FromEnter( object sender, EventArgs e )
{
if ( LicenseManager.UsageMode != LicenseUsageMode.Designtime && DoubleClickSupport && listBoxFrom != null )
{
Form f = listBoxFrom.FindForm();
previousButton = f.AcceptButton;
f.AcceptButton = button;
}
}