
之前就有人提到Google map的路徑規劃會叫人游泳渡過太平洋、划獨木舟渡台灣海峽,沒想到今天Chrome也讓我開了眼界。
自己常常在寫code,也花了不少時間在網路上尋找語法和解決方案,但時間一久,就把找到的答案給忘了。為了方便自己回頭來找答案,並讓同好能找到正確的解答,隨手將各種語法使用技巧貼上來,和各位同享。
function test(width){
var myObj = new azObject(width) ;
alert(myObj.width);
myObj.enlarge(2);
alert(myObj.width);
}
function azObject(_width){
this.width = _width ;
this.enlarge = azEnlarge ;
}
function azEnlarge(plus){
this.width = this.width * plus ;
}
Page GridView Button
------------ ------------ ------------
1 Init
2 Load
3 Load
4 RowCreated
5 RowDataBound
6 DataBound
7 Click
8 PreRender
public static void renderEmptyGridView(GridView EmptyGridView, string FieldNames)
{
//將GridView變成只有Header和Footer列,以及被隱藏的空白資料列
DataTable dTable = new DataTable();
char[] delimiterChars = {','};
string[] colName = FieldNames.Split(delimiterChars);
foreach (string myCol in colName)
{
DataColumn dColumn = new DataColumn(myCol.Trim());
dTable.Columns.Add(dColumn);
}
DataRow dRow = dTable.NewRow();
foreach (string myCol in colName)
{
dRow[myCol.Trim()] = DBNull.Value;
}
dTable.Rows.Add(dRow);
EmptyGridView.DataSourceID = null;
EmptyGridView.DataSource = dTable;
EmptyGridView.DataBind();
EmptyGridView.Rows[0].Visible = false;
}
protected void GridView1_PreRender(object sender, EventArgs e)
{
if (GridView1.Rows.Count == 0)
{
renderEmptyGridView(GridView1, "FLOW_UID, FLOW_CODE, FLOW_NAME, FLOW_TYPE");
}
}
protected void GridView1_Load(object sender, EventArgs e)
{
//回復原本GridView的資料連結
GridView1.DataSource = null;
GridView1.DataSourceID = "SqlDataSource1";
}