2014年11月25日 星期二
2014年10月14日 星期二
[ASP.NET]觀念
1. 一個ASP.NET網頁,只能有一個表單(<Form>)標籤.
2. 所有的ASP.NET控制項都必須放在
<form runat="server">
...
</form>
2. 所有的ASP.NET控制項都必須放在
<form runat="server">
...
</form>
[ASP.NET]為GridView 加上光棒效果(use javascript)
1. 在GridView的RowDataBound事件中
2. 加入
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("OnMouseover", "this.style.backgroundColor='#E3EAEB'");
e.Row.Attributes.Add("OnMouseout", "this.style.backgroundColor='#FFFFFF'");
}
2014年9月1日 星期一
[ASP.NET]將控制項Panel內的子控制項Textbox找出加總
int counter = 0;
foreach (Control c in Panel1.Controls)
{
if (c is TextBox)
{
counter += Convert.ToInt32(((TextBox)c).Text);
}
}
Response.Write(counter.ToString());
foreach (Control c in Panel1.Controls)
{
if (c is TextBox)
{
counter += Convert.ToInt32(((TextBox)c).Text);
}
}
Response.Write(counter.ToString());
[ASP.NET]編輯資料時,固定位置(MaintainScrollPositionOnPostBack)
為了避免GridView進入編輯模式時,畫面重整後自動跳到最上面的一列.
在 .aspx 中
<%@Page Language="C#"
MaintainScrollPositionOnPostBack="true"
%>
在 .aspx 中
<%@Page Language="C#"
MaintainScrollPositionOnPostBack="true"
%>
訂閱:
文章 (Atom)
讓ASP.NET網站在開發除錯時期擁有WEB.CONFIG文件轉換功能
ref: https://blog.kkbruce.net/2016/09/enabling-xml-document-transforms-for-all-asp-net-web-by-develop-time.html#.XoP1KGMzbRY
-
https://docs.microsoft.com/zh-tw/dotnet/framework/data/transactions/using-system-transactions-in-aspnet <system.web> <co...
-
x-ua-compatible 頭標籤大小寫不敏感,必須用在 head 中,必須在除 title 外的其他 meta 之前使用。 https://read01.com/zh-tw/KkDzm6.html#.WsGJSi5ubRY
-
IS NULL 判斷值是否為NULL 學號 成績 S0001 56 S0001 73 S0002 92 S0002 63 S0003 92 S0003 70 S0004 75 S0004 88 S0004 68 S0005 NU...