csgashine

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  9 随笔 :: 23 文章 :: 2 评论 :: 0 引用

公告

2006年4月18日 #

Calling Base Class Constructors

Classes can't inherit constructors, a derived class must implement its own constructor and can only make use of the constructor of its base class by calling it explicitly.

if the base class has an accessible default constructor, the derived constructor is not required to invoke the base constructor explicitly; instead, the default constuctor is called implicitly.

However, if the base class doesn't have a default constructor, every derived constructor must explicitly invoke one of the base class constructors using the base keyword.
posted @ 2006-04-18 11:05 asp-shine 阅读(103) 评论(1) 编辑

2006年3月24日 #

  • Web pages(.aspx files):These are the cornerstones of any ASP.NET application.

 

  • Web services(.asmx files):These allow you to share useful functions with applications on other computers and other platforms.

 

  • Code-behind files:Depending on the code model you’re using, you may also have separate source code files. If these files are coded in C#, they have the extension .cs.

 

  • A configuration file(web.config):This file contains a slew of application-level setting that configure everything from security to debugging and state management.

 

  • Global.asax:This file contains event handlers that react to global application events(such as when the application is first being started).

 

  • Other components:These are compiled assemblies that contain separate components you've developed or third-party components with useful functionality.Components allowyou to separate business and data access logic and create custom controls.
posted @ 2006-03-24 19:41 asp-shine 阅读(54) 评论(0) 编辑

2006年3月23日 #

         Every control declaration must have a corresponding closing tag or the empty element /> syntax at the end of the opening tag. In orther words, Asp.net tags follow the same rules as tags in XHTML. 

        All Web controls must be declared within a server-side form tag(and there can be only one server-side form per page), even if they don't cause a postback. Otherwise, you'll get a runtime error. This rule is not necessary when working with HTML server controls, provided you don't need to handle postbacks.

posted @ 2006-03-23 22:10 asp-shine 阅读(93) 评论(0) 编辑

2006年3月22日 #

    the following code dynamically creates a table with five rows and four cells per
row, sets their colors and text, and shows all this on the page.
  protected void Page_Load(object sender, System.EventArgs e)
{
// Create a new HtmlTable object.
HtmlTable table1 = new HtmlTable();
// Set the table's formatting-related properties.
table1.Border = 1;
table1.CellPadding = 3;
table1.CellSpacing = 3;
table1.BorderColor = "red";
// Start adding content to the table.
HtmlTableRow row;
HtmlTableCell cell;
for (int i=1; i<=5; i++)
{
// Create a new row and set its background color.
row = new HtmlTableRow();
row.BgColor = (i%2==0 ? "lightyellow" : "lightcyan");
for (int j=1; j<=4; j++)
{
// Create a cell and set its text.
cell = new HtmlTableCell();
cell.InnerHtml = "Row: " + i.ToString() +
"<br />Cell: " + j.ToString();
// Add the cell to the current row.
row.Cells.Add(cell);
}
// Add the row to the table.
table1.Rows.Add(row);
}
// Add the table to the page.
this.Controls.Add(table1);
}

    This example contains two nested loops. The outer loop creates a row. The inner loop then
creates the cells and adds them to the Cells collection of the current row. When the inner loop ends,
the code adds the entire row to the Rows collection of the table. The final step occurs when the
outer loop is finished. At this point, the code adds the completed table to the Controls collection
of the page.
    This example used a table because it gave a good opportunity to show how child controls (cells
and rows) are added to the Controls collection of the parent, but of course this mechanism works
with any other server control.
posted @ 2006-03-22 17:54 asp-shine 阅读(92) 评论(0) 编辑

2006年3月19日 #

what is the View State?

Which automatically embeds information about the page in a hidden field in the rendered HTML.

posted @ 2006-03-19 13:47 asp-shine 阅读(101) 评论(1) 编辑

2006年3月18日 #

摘要: To make sure this system works, you must keep both the .aspx markup file(with the control)and the .cs file(with the source code)synchronized. If you edit control names in one piece using another tool(...阅读全文
posted @ 2006-03-18 23:31 asp-shine 阅读(72) 评论(0) 编辑

2006年1月24日 #

摘要: 1.Defining InterfaceThe symtax of defining an Interface is as follows:[attributes] [access-modifier] interface interface-name [:base list]{interface body}What about the Attributes????Acess modifier in...阅读全文
posted @ 2006-01-24 22:41 asp-shine 阅读(115) 评论(0) 编辑

2006年1月22日 #

摘要: Struct is value type. When it used as a parameter of Functions, it is passed by values which is the copy of the struct. When you return t the calling function, the values are unchanged. While you chan...阅读全文
posted @ 2006-01-22 21:58 asp-shine 阅读(129) 评论(0) 编辑

2005年11月29日 #

摘要: It's so excited that I have a homepage. I hope I can bea member of the family of .Net阅读全文
posted @ 2005-11-29 16:52 asp-shine 阅读(53) 评论(0) 编辑

仅列出标题