原创 PostBackUrl在前臺傳值

            <asp:DataGrid ID="DtGrd" runat="server" CssClass="datagrid1"                 AutoGenerateColumns="False" C

原创 asp.net中PlaceHolder佔位控件

https://www.jb51.net/article/82901.htm

原创 下拉項目後重新生成,不報錯,有警告,生成失敗

雙擊警告信息,將警告對應的引用從項目中排除。

原创 將查詢出來的數據插入到表1中的SQL語句:insert into 表1 select 字段列表 from 表(n) where 條件

語法:insert into 表1    select 字段列表 from 表(n) where 條件 相當於 複製和粘貼,  select 後加要複製的東西,insert into 粘貼到 注意:只要查詢出來的字段列表與要插入的表的字段

原创 datagrid分頁的綁定

如果datagrid當前顯示頁的索引  表的總行數-1/單頁上顯示的項數 if (dtgrid.CurrentPageIndex > (dt.Rows.Count - 1) / dtgrid.PageSize)    dtgrid.Cur

原创 在後臺給input標籤加屬性

前臺:input 標籤<input  type="text" id="text1"> 後臺:給input 標籤加屬性。 text1.style.add("color","red");

原创 js驗證文本框輸入的值只能是9位或者11位的數字(電話號碼) 小數或整數(面積)

    <script type="text/javascript"> //9位或者11位的數字(電話號碼)         function chk(n) { // 檢測函數zhidao             var p = /^[\

原创 .net中在後臺給input標籤添加楊樹

enterTime.Style.Add("Color", "red");

原创 c# 中驗證文本框輸入值必須爲整數或小數

try { int num; num = int.Parse(textBox1.Text.Trim()); } catch { try { float num = float.Parse(textBox1.Text.Trim()); }

原创 在datagrid中,獲取當前頁

if (dtgrid.CurrentPageIndex > (dt.Rows.Count - 1) / dtgrid.PageSize)     dtgrid.CurrentPageIndex = (dt.Rows.Count - 1)

原创 Guid.NewGuid().ToString().Replace("-", "");

Guid.NewGuid().ToString().Replace("-", ""); //生成一個隨機全球唯一字符串,並且用空字符替換其中的-號 fileNewName=Guid.NewGuid().ToString().Replace

原创 在後臺獲取前臺datagrid中的input元素

獲取text類型的: HtmlInputText Txt4 = e.Item.FindControl("Txt4") as HtmlInputText; 獲取file類型的: HtmlInputFile file4 =e.Item.Fin

原创 datagrid當前頁編輯

所需效果圖: 點擊新增:   點擊上傳文件: 點擊編輯: 點擊刪除: 前臺:                         <asp:DataGrid ID="DataGrid1" runat="server" Width="

原创 在後臺獲取file類型的input標籤

 HtmlInputFile Insertfile4 = (HtmlInputFile)e.Item.FindControl("Insertfile4") as HtmlInputFile;

原创 datagrid中的分頁不能居中

問題: 解決辦法:        <style>            .Table1 td {              height: 36px;              text-align:center !important;