惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - 北极冰点水

如何用C#代码设置文件的附加属性啊 例如author, subject 这些啊 在.NET中使TextBox只能输入数字的方法(key 和 clipboardData) - 北极冰点水 怎样在XML中使用&和字符 ViewState深入,Textbox,Checkbox,CheckboxList,RadioButtonList 不能禁止ViewState textbox web控件 根本无视enableviewsate 是否true 或者false, 依然能够相应用户的输入 什么是One-Click技术 未将对象引用到对象的实例 asp.net执行.sql文件 和 Cmd 模式执行sql文件 - 北极冰点水 后期维护成本 用.net开发不同操作系统下应用的winform的size大小问题 怎样让用户可以跟踪查询数据库数据变化 在MembershipProvider中,现在的版本中MobileAlias 是没用的 也谈下vs2005中的gridview Vs2005 调试状态下的异常处理是比2003要好多了,布局图片也漂亮 vs2005的数据库连接问题 2.0 Master Page C# 的 Delegate Type 安装SqlServer2005 Express Edit版 和 Vs 2005 CTP版 快速”格式化和常规格式化之间的区别
vs2005 Gridview 得问题???
北极冰点水 · 2005-12-07 · via 博客园 - 北极冰点水

想在Gridview中建一Command列,建在关键field中,但是使用GridView1.Rows[i].Cells[1].Text.Trim();取出来得居然是空,虽然以前在vs2003中可以隐藏关键值列取出text,但是2005中隐藏列取出得text也是"",不得已只能使用select属性,但是真不美观,唉,也许还有其他方法吧,各位使用vs2005 gridview 得高人不知也没碰到过?暂且记下
    还有点击select后首先触发rowcommand事件,在rowcommand事件中sender是Gridview1,selectindex=-1无法获取当前select行中得cell值,然后才是SelectIndexchanged事件;所以对于select事件代码只能写在GridView1_SelectedIndexChanged(object sender, EventArgs e)
中了.我记得在vs2003中是DataGrid_Itemcommand事件中作这些事吧,vs2003和vs2005还真是不一样,继续熟悉中.下面是偶得测试代码片断

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
      

/*点击select后首先处罚rowcommand事件,在rowcommand事件中sender是Gridview1,无法获取当前select行中得cell值,然后才是SelectIndexchanged事件
        commandfield,Boundfield visible=false也无法获取????
        * int i = GridView1.SelectedIndex;
        if (i != -1)
        {
            string UserName = GridView1.Rows[i].Cells[1].Text.Trim();

            Response.Redirect("UserProfile.aspx?UserName=" + UserName);
        }*/

            
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        int i = GridView1.SelectedIndex;
        string UserName = GridView1.Rows[i].Cells[1].Text.Trim();
     
        Response.Redirect("UserProfile.aspx?UserName=" + UserName);
      
    }