关于网友提出的“每一分每一秒都给你 麻烦师傅们给每行代码添上注释!说明每行代码的意思!还有作用!谢谢了!急用!”问题疑问,本网通过在网上对“每一分每一秒都给你 麻烦师傅们给每行代码添上注释!说明每行代码的意思!还有作用!谢谢了!急用!”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题:每一分每一秒都给你 麻烦师傅们给每行代码添上注释!说明每行代码的意思!还有作用!谢谢了!急用!
描述:
一.控件页
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
public partial class WebUserControl : System.Web.UI.UserControl
{
private int m_Step = 1;
[Browsable(true)]
[Category("可访问性")]
[Description("调整步长")]
public int Step
{
get
{
if (this.ViewState["Step"] != null)
{
return (int)this.ViewState["Step"];
}
return 1;
}
set
{
this.ViewState["Step"] = value;
}
}
#region Properties
///
/// 用于提供对外的接口,获得当前数字文本所记录的数字。
///
public int Numeric
{
get
{
return Convert.ToInt32(this.txtNumeric.Text);
}
set
{
this.txtNumeric.Text = value.ToString();
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
}
///
/// 上调按钮的Click事件。
///
///
///
protected void btnUp_Click(object sender, EventArgs e)
{
this.Numeric += this.Step;
}
///
/// 下调按钮的Click事件。
///
///
///
protected void btnDown_Click(object sender, EventArgs e)
{
this.Numeric -= this.Step;
}
}
二.调用页
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SaleOrder.aspx.cs" Inherits="SaleOrder" %>
<%@ Register TagPrefix="UC1" TagName="WebUserControl1" Src="~/WebUserControl.ascx" %>
<%@ Register TagPrefix="UC2" TagName="WebUserControl2" Src="~/WebUserControl.ascx" %>
无标题页