<%...@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Theme="default"%> 2 3<%...@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> 4 5<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 6<html xmlns="http://www.w3.org/1999/xhtml"> 7<head runat="server"> 8 <title>Untitled Page</title> 9</head> 10<body> 11 <form id="form1" runat="server"> 12 <asp:ScriptManager ID="ScriptManager1" runat="server" /> 13 <div> 14 <asp:UpdatePanel ID="UpdatePanel1" runat="server"> 15 <ContentTemplate> 16 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID" 17 DataSourceID="SqlDataSource1"> 18 <Columns> 19 <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" 20 ReadOnly="True" SortExpression="CategoryID" /> 21 <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" /> 22 <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> 23 <asp:TemplateField> 24 <ItemTemplate> 25 <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/btn_edit.gif" 26 OnClick="ImageButton1_Click" /> 27 </ItemTemplate> 28 </asp:TemplateField> 29 </Columns> 30 </asp:GridView> 31 <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="Add" /><br /> 32 33 <asp:Button ID="Button3" runat="server" Text="Button" Width="275px" Style="display: none" mce_Style="display: none" /> 34 <cc1:modalpopupextender id="ModalPopupExtender1" runat="server" targetcontrolid="Button3" PopupControlID="Panel1" Drag="true" BackgroundCssClass="modalBackground"></cc1:modalpopupextender> 35 36 <asp:Panel ID="Panel1" runat="server" CssClass="modalBox" Style="display: none;" mce_Style="display: none;" Height="96px" Width="347px"> 37 <asp:HiddenField ID="HiddenField1" runat="server" /> 38 <table> 39 <tr> 40 <td style="width: 100px"> 41 Name:</td> 42 <td style="width: 128px"> 43 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td> 44 </tr> 45 <tr> 46 <td style="width: 100px"> 47 Description:</td> 48 <td style="width: 128px"> 49 <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td> 50 </tr> 51 <tr> 52 <td style="width: 100px"> 53 </td> 54 <td style="width: 128px"> 55 <asp:Button ID="Button1" runat="server" Text="Save" OnClick="Button1_Click" /> 56 <asp:Button ID="Button2" runat="server" Text="Cancel" /></td> 57 </tr> 58 </table> 59 </asp:Panel> 60 </ContentTemplate> 61 </asp:UpdatePanel> 62 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 63 SelectCommand="SELECT [CategoryID], [CategoryName], [Description] FROM [Categories]" UpdateCommand="UPDATE Categories SET CategoryName = @name, Description = @des WHERE (CategoryID = @id)" InsertCommand="INSERT INTO Categories(CategoryName, Description) VALUES (@name, @des)"> 64 </asp:SqlDataSource> 65 66 </div> 67 </form> 68</body> 69</html> using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8using System.Web.UI.WebControls.WebParts; 9using System.Web.UI.HtmlControls; 10using System.Data.SqlClient; 11//From bbs.51aspx.com 12public partial class _Default : System.Web.UI.Page 13...{ 14 protected void Page_Load(object sender, EventArgs e) 15 ...{ 16 17 } 18 protected void ImageButton1_Click(object sender, ImageClickEventArgs e) 19 ...{ 20 ImageButton btnEdit = sender as ImageButton; 21 GridViewRow row = (GridViewRow)btnEdit.NamingContainer; 22 //this.UpdatePanel1.Update(); 23 this.HiddenField1.Value = row.Cells[0].Text; 24 this.TextBox1.Text = row.Cells[1].Text; 25 this.TextBox2.Text = row.Cells[2].Text; 26 this.ModalPopupExtender1.Show(); 27 } 28 protected void Button1_Click(object sender, EventArgs e) 29 ...{ 30 SqlCommand cmd = null; 31 if ("add" == this.HiddenField1.Value) 32 cmd = new SqlCommand(this.SqlDataSource1.InsertCommand); 33 else 34 cmd = new SqlCommand(this.SqlDataSource1.UpdateCommand); 35 using (cmd) 36 ...{ 37 using (cmd.Connection = new SqlConnection(this.SqlDataSource1.ConnectionString)) 38 ...{ 39 cmd.Connection.Open(); 40 cmd.Parameters.AddWithValue("@name", this.TextBox1.Text); 41 cmd.Parameters.AddWithValue("@des", this.TextBox2.Text); 42 if ("add" != this.HiddenField1.Value) 43 cmd.Parameters.AddWithValue("@id", Convert.ToInt32(this.HiddenField1.Value)); 44 cmd.ExecuteNonQuery(); 45 } 46 } 47 48 this.GridView1.DataBind(); 49 this.ModalPopupExtender1.Hide(); 50 51 } 52 protected void Button4_Click(object sender, EventArgs e) 53 ...{ 54 this.HiddenField1.Value = "add"; 55 this.TextBox1.Text = ""; 56 this.TextBox2.Text = ""; 57 this.ModalPopupExtender1.Show(); 58 } 59}
本文分享自華爲雲社區《6個實例帶你解讀TinyVue 組件庫跨框架技術》,作者: 華爲雲社區精選。 在DTSE Tech Talk 《 手把手教你實現mini版TinyVue組件庫 》的主題直播中,華爲雲前端開發DTSE技術佈道師阿健老師給
查詢出來的日期數據比數據庫中日期數據晚8小時,一開始很懵逼,IDEA 和 server 時區都一樣呢!後來發現: jdbcUrl=jdbc:mysql://localhost:hentai?useUnicode=true&character
作者:柳遵飛 Nacos 作爲配置中心經常存儲一些敏感信息,但是由於誤用導致安全風險,最常見的主要是以下兩個問題: 1)Nacos 暴露公網可以嗎?不可以,因爲 Nacos 定位是註冊配置中心,是內部系統,不應該暴露到公網使用。 2)不得已
本文分享自華爲雲社區《對接HiveMetaStore,擁抱開源大數據》,作者:睡覺是大事。 1. 前言 適用版本:9.1.0及以上 在大數據融合分析時代,面對海量的數據以及各種複雜的查詢,性能是我們使用一款數據處理引擎最重要的考量
轉載自第一片心意 1 前言 由於海豚調度器官網的集羣部署文檔寫的較亂,安裝過程中需要跳轉到很多地方進行操作,所以自己總結了一篇可以直接跟着從頭到尾進行操作的文檔,以方便後續的部署、升級、新增節點、減少節點的相關操作。 2. 提前準備 2.
DevExpress Blazor UI組件使用了C#爲Blazor Server和Blazor WebAssembly創建高影響力的用戶體驗,這個UI自建庫提供了一套全面的原生Blazor UI組件(包括Pivot Grid、調度程序、圖
SSE(Server-Sent Events)是一種用於實現服務器主動向客戶端推送數據的技術,也稱爲“事件流”(Event Stream)。它基於 HTTP 協議,利用了其長連接特性,在客戶端與服務器之間建立一條持久化連接,並通過這條連接實
SOFA 六週年,歡迎來玩 本週六 4.20 上海螞蟻集團 S 空間 掃碼免費報名活動,來與 MOSN 社區負責人線下交流~ MOSN 社區歡迎您的加入! MOSN 官網:https://mosn.io/ MOSN Github:http
在網絡通信中,代理服務器是一種重要的網絡中間件,它可以作爲客戶端和服務器之間的中轉站,增強網絡安全性、提高訪問速度、隱藏真實IP地址等。Python作爲一種強大的編程語言,提供了豐富的庫和模塊,使得實現和配置代理服務器變得非常簡單。本文將介
近日,Zabbix和OceanBase成功完成了兼容認證。Zabbix支持OceanBase作爲後臺數據庫存儲配置數據和歷史數據,並且性能更優於MySQL數據庫。 Zabbix簡略系統拓撲圖: Zabbix Server和Zabbix
MySQL 級聯複製的坑,我幫你們踩了。 作者:蔣士峯,愛可生 DBA 團隊成員,熟悉 MySQL,Oracle 等數據庫。每天的積累,時間久了,會帶來不一樣的收貨。 愛可生開源社區出品,原創內容未經授權不得隨意使用,轉載請聯繫小編並註明
版本說明 由於作者目前接觸當前最新版本爲2.3.4 但是官方提供的web版本未1.0.0,不兼容2.3.4,因此這裏仍然使用2.3.3版本。 可以自定義兼容處理,官方提供了文檔:https://mp.weixin.qq.com/s/Al1V
優雅關閉 在 v4 中關閉一個流通過改變流的生命週期實現 v4 中流有一個 G(goroutine)專門負責管理流的生命週期,並使用狀態自動機來實現狀態變更。 但是在退出發佈者或者訂閱者,仍然遇到一些問題,首先發布者和訂閱者各自有自己的
前端面試題 - null是原始類型,但爲什麼typeof null的結果是object? 造成這個結果的原因是null的內存地址是以000開頭,而js會將000開頭的內存地址視爲object。 通過isNull()來判斷一個值是不是null
前端面試題 - 賦值/淺拷貝/深拷貝的區別?如何實現一個深拷貝? 賦值是拷貝的對象指針,整個對象都是共用的。 淺拷貝是拷貝一層,對象的內容仍是共用的,Object.assign(),拓展運算符都是淺拷貝。 深拷貝是遞歸拷貝深層次,JSON