?? textboxwatermark.aspx.cs
字號(hào):
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
using System;
using System.Web;
public partial class TextBoxWatermark_TextBoxWatermark : CommonPage
{
/// <summary>
/// Override Page_Load to populate initial label text
/// </summary>
/// <param name="sender">source</param>
/// <param name="e">argument</param>
protected void Page_Load(object sender, EventArgs e)
{
Button1_Click(null, null);
}
/// <summary>
/// Handle submit button click to populate label
/// </summary>
/// <param name="sender">source</param>
/// <param name="e">argument</param>
protected void Button1_Click(object sender, EventArgs e)
{
string firstName = (("" == TextBox1.Text) ? "[blank]" : TextBox1.Text);
string lastName = (("" == TextBox2.Text) ? "[blank]" : TextBox2.Text);
Label1.Text = HttpUtility.HtmlEncode(string.Format("Hello {0} {1}!", firstName, lastName));
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -