BoundField be changed to textbox in .Net 4.0

Question:
<asp:GridView ID="GridView1"   AutoGenerateColumns="False" DataKeyNames="Id" 
            runat="server" onrowediting="GridView1_RowEditing">
        <Columns>
        <asp:BoundField DataField="Id" HeaderText="ID" Visible="False" />
        <asp:BoundField DataField="FirstName" HeaderText="First Name" />
        <asp:BoundField DataField="LastName" HeaderText="Last Name" />
        <asp:TemplateField>
            <ItemTemplate>
                <asp:ImageButton ID="imageButton" AlternateText="Edit" CausesValidation="false" CommandName="Edit" runat="server" /> 

            </ItemTemplate>
        </asp:TemplateField>
        </Columns>
        </asp:GridView>


public partial class _Default : System.Web.UI.Page
    {
        public class Person
        {
            public string FirstName { get; set; }
            public string LastName { get; set; }
            public int Id { get; set; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List<Person> people = new List<Person>() { new Person { FirstName = "Mike", Id = 1, LastName = "Myers" }, new Person() { FirstName = "John", Id = 2, LastName = "Smith" } };
                GridView1.DataSource = people;
                GridView1.DataBind();
            }
        }

        protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {

        }
    }

Solution:
change this 'edit' to other string. ex. 'edit1'...
<asp:ImageButton ID="imageButton" AlternateText="Edit" CausesValidation="false" CommandName="Edit" runat="server" /> 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/310974/viewspace-1985053/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/310974/viewspace-1985053/

C#实战:如何用winmm.dll打造毫秒级高精度定时器(附完整代码) 本文详细介绍了在C#中利用winmm.dll实现毫秒级高精度定时器的完整方案。针对.NET内置定时器精度不足的问题,通过调用timeSetEvent等原生API,提供了超越系统时钟中断周期的精准定时能力。文章包含核心原理剖析、完整的封装类代码以及音视频处理、游戏开发等场景下的实战应用与性能调优指南。 阅读详情

相关推荐

Sentinel-1 Burst数据处理避坑实录:从aria2c报错到wget脚本救场

本文详细介绍了Sentinel-1 Burst数据处理的完整解决方案,从下载困境到高效处理技巧。针对aria2c报错等常见问题,提供了增强版wget脚本和智能分组方法,显著提升下载成功率和处理效率,特别适合科研机构和企业级网络环境下的哨兵数据处理需求。

weixin_42641998的博客 284

asp:boundfield html,设置文本格式在ASP.Net的BoundField

TextMode="MultiLine" Rows="20" Columns="100" Wrap="True" HtmlEncode="True" />我使用的BoundField的HTML编码性能,以确保对互网站脚本攻击。我想要做的是,当用户重新打开编辑窗口,我想要解码和呈现编码的html,html标签和所有。我的问题是,当我尝试在代码隐藏中解码HTML时,在Page_Load函数下,当...

weixin_32818365的博客 696

避开PFC设计大坑:从环路分析到参数整定的5个常见误区与解决方案

本文深入解析PFC电路设计中从环路分析到参数整定的5个常见误区,包括电感参数设计、小信号模型适用边界、电压环与电流环耦合效应等。通过实际案例和PSIM仿真数据,提供工程落地的解决方案,帮助工程师避开设计陷阱,提升电路性能与可靠性。

weixin_30666401的博客 325

BoundField与TemplateField的区别

数据绑定列是通过 asp:BoundField 或 TemplateField 元素定义的。通过设置 DataField 属性,可以将 BoundField 绑定到 GridView 的关联数据源:这将告诉 GridView 控件,当它处于查看模式时,应该在 span 元素中显示 ShipCity 值。当 GridView 处于编辑模式时,选定行中的这一列将在适当的 HTML 元素中显示。在这

whight的专栏 3039

TMP112/TMP102温度传感器驱动开发与嵌入式实战

数字温度传感器是嵌入式系统环境感知的核心器件,其通过I²C等标准总线实现高精度、低功耗测温。原理上依赖ΔΣ模数转换与二进制补码数据格式,结合寄存器配置实现模式控制、阈值报警与功耗管理。技术价值体现在±0.5°C级精度、1μA级静态电流及SOT-563超小封装带来的系统集成优势。广泛应用于工业MCU热监控、电池物联网终端、医疗电子温度补偿及汽车ECU板级测温等场景。本文围绕TMP112/TMP102展开,深入解析寄存器协议、硬件接口约束、HAL驱动分层设计、FreeRTOS任务调度及生产级校准方法,覆盖从芯片

weixin_35756690的博客 674

Python制作【大麦网】自动抢票程序

Python 的迅速崛起对整个行业来说都是极其有利的,但“人红是非多”,导致它平添了许许多多的批评,不过依旧挡不住它火爆的发展势头。如果你对Python感兴趣,想要学习pyhton,这里给大家分享一份Python全套学习资料,都是我自己学习时整理的,希望可以帮到你,一起加油!😝有需要的小伙伴,可以点击下方链接免费领取或者V扫描下方二维码免费领取🆓点击这里。

mate1357的博客 2万+

.NET数据绑定时BoundField与TemplateField的区别

数据绑定列是通过 asp:BoundField 或 TemplateField 元素定义的。通过设置 DataField 属性,可以将 BoundField 绑定到 GridView 的关联数据源:     SortExpression="ShipCity"> 这将告诉 GridView 控件,当它处于查看模式时,应该在 span 元素中显示 ShipCity 值。当 GridView 处于编

晴空云鹤 5689

别再一个个BAPI调了!用CVI_EI_INBOUND_MAIN一次性搞定SAP BP主数据(附完整ABAP代码)

本文详细介绍了如何使用SAP标准函数CVI_EI_INBOUND_MAIN高效维护业务伙伴(BP)主数据,替代传统的多BAPI调用方式。通过完整ABAP代码示例,展示了如何一站式处理供应商、客户、公司代码等所有视图的创建与更新,提升数据一致性和开发效率。

weixin_29204205的博客 291

asp.net小技巧:保留password模式文本框textbox内的数据不丢失。

在asp.net 2.0环境下,使用textbox,提交到服务器再传回,如果textbox是password模式的,那么textbox内的密码(星号、圆点),就没有了! 一个可行的做法是: protected override void OnPreRender(EventArgs args) { base.OnPreRender(args); Pass...

aini4611的博客 250

软硬件融合加速技术系列文章

目录 文章目录目录计算机组成原理Linux 操作系统原理处理器进程管理内存管理I/O 系统文件系统网络协议栈资源管理设备管理GPUFPGASmartNIC/DPU 计算机组成原理 《计算机组成原理 — 冯诺依曼体系结构》 《计算机组成原理 — 基本硬件设备》 《计算机组成原理 — CPU 中央处理器》 《计算机组成原理 — 指令系统》 《计算机组成原理 — 总线系统》 《计算机组成原理 — 存储系统》 《计算机组成原理 — 输入输出系统 — 存储控制器接口类型》 《计算机组成原理 — 服务器》 《计算机组成

烟云的计算 6806

iStoreOS等软路由插件卸载的残留?分享一款软路由高级卸载工具,自定义卸载,轻松解决卸载残留问题

iStoreOS用户看过来!👀 还在被插件包残留困扰吗?本文分享一款“高级卸载”的插件,助你深度清理iStoreOS系统,彻底解决软件卸载不净的痛点,告别频繁恢复出厂设置的烦恼!🚀

XiaoqiangClub的博客 1540

ASP.NET 中TextBox设置ReadOnly="true" 无法取到值的做法

当 TextBox设置了ReadOnly="true" 后,要是在前台为控件添加了值,后台是取不到的,值为“空” 原理没想通,说不清楚微软是出于什么考虑的, 不过有时是要我们能通过前台脚本来填充值,并不希望用户修改其控件内容,这时就比较尴尬了。 刚开始是换成Html 里的 <input type="text" readonly="readonly" > ,不过后来发现这个工作量是...

weixin_33877092的博客 111

SAP GR(Group Reporting)配置篇(五)

1.5、合并的货币换算1.5.1指定折算比率菜单路径组报表的SAP S4HANA >合并的货币换算>-指定折算汇率事务代码GCRF说 明1.5.2维护汇率菜单路径组报表的SAP S4HANA >合并的货币换算>维护汇率事务代码CXCC/OB08说 明实际测试的时候根据实际情况维护汇率。输入换算比率。1.5.3定义汇率标识符菜单路径组报表的SAP S4HANA >合并的货币换算>定义汇率标识符事务代码OC41说 明配置了月末汇率和平均汇率。

weixin_43853754的博客 554

GridView更新操作问题

在RowUpdating的事件里,怎么样获取 里的值???   方法1:   try   something   like GridViewRow   row   =   GridView1.Rows[e.RowIndex]; if   (row   !=   null) {     TextBox   tb   =   row.Cells[n].Contr

Finder_Way 639

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

JavaScript访问GridView的绑定列(Access the Bound field of Gridview by javascript)

    &lt;form id="form1" runat="server"&gt;  &lt;asp:GridView ID="GridView1" AutoGenerateColumns="False" ShowHeader="True" runat="server" OnRowDataBound="GridView1_RowDataBound&

weixin_34067102的博客 84

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

asp.net学习之扩展GridView

本节讨论如何从现有的控件,进而扩展成强大的,更定制的GridView控件 1.扩展BoundField 默认的BoundField不能显示多文本,文字一多,就会扩大整个Table的Height值,解决这个问题的方法可以通过TemplateField加入Div控件来解决,但是,也可以从BoundField类上进行扩展,加入一点特有的功能,让他能够显示多文本 例1: ...

weixin_30393907的博客 73

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

ASP.NET 2.0数据教程之十二:在GridView控件中使用TemplateField(转)

导言 The GridView is composed of a set of fields that indicate what properties from the datasource are to be included in the rendered output along with how the data will be displayed. (GridView是由一...

aoluan2964的博客 276

asp.net的GridView字段显示过长问题

方法一:最简单.绑定gridview单元格内容过长,用tooltip,单元格截取指定长度,鼠标停留时显示全部内容,          protected void gv_DataBound(object sender, EventArgs e)          {              // 演示ToolTip,使用GridView自带的ToolTip              for

weity999的专栏 3698

ASP.NET WEBFORM 中导出数据,使用文件流的方式

效果图: 前台使用了gridview控件: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="E_CKBB.aspx.cs" Inherits="DRP.sales.E_CKBB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 T...

anhuanjiaoci044699的博客 567

(转)GridView控件中加入动态生成的控件

前台代码如下: <asp:GridView ID="testDatagrid" runat="server" AutoGenerateColumns="False" OnRowDataBound="testDatagrid_RowDataBound" Width="294px" Height="134px"> <Columns> ...

weixin_30872733的博客 76

Gridview][UpdateCommand的写法要点]

在ASP.NET2.0中的GridView为我们浏览更新数据提供了一个方便的途径。我们只需要添加一个sqldatasouce控件和一个GridView,再为sqldatasource写上正确的UpdateCommand语句就可以达到自动更新数据的目的。基本上无需手写更新代码:但在写UpdateCommand语句时,需注意,updateCommand中各Sql更新参数的顺序必须与页面输出数据的顺序一

深度Java 5909

VS2005新控件之GridView 使用高级技巧系列2

下面开始我们的GridView控件使用之高级技巧 1:添加移除列 2:改列头名 3:将某列设置特殊格式 4:增加鼠标动作 5:为特定的数改变行样式 6:客户端隐藏示特定

喝了这杯酒大家就是兄弟 1084

ASP,深度集成,技术实现

我见过很多技术leader在面试的时候,遇到处于迷茫期的大龄程序员,比面试官年龄都大。这些人有一些共同特征:可能工作了7、8年,还是每天重复给业务部门写代码,工作内容的重复性比较高,没有什么技术含量的工作。问到这些人的职业规划时,他们也没有太多想法。其实30岁到40岁是一个人职业发展的黄金阶段,一定要在业务范围内的扩张,技术广度和深度提升上有自己的计划,才有助于在职业发展上有持续的发展路径,而不至于停滞不前。不断奔跑,你就知道学习的意义所在!

m0_61067876的博客 953
上一篇: reporting services lookup
下一篇: disable CompatTelRunner.exe
cuichen4524
博客等级 码龄11年 0粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值