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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
The Last Watchdog
The Last Watchdog
T
Tenable Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
V
Vulnerabilities – Threatpost
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
A
Arctic Wolf
云风的 BLOG
云风的 BLOG
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
Spread Privacy
Spread Privacy
S
Schneier on Security
Project Zero
Project Zero
L
LINUX DO - 热门话题
M
MIT News - Artificial intelligence
F
Full Disclosure
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
Cyberwarzone
Cyberwarzone
AWS News Blog
AWS News Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tailwind CSS Blog
K
Kaspersky official blog
Recent Announcements
Recent Announcements
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
P
Privacy & Cybersecurity Law Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Exploit Database - CXSecurity.com
V
Visual Studio Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Webroot Blog
Webroot Blog

博客园 - 阮

Database access assembly build program. - 阮 Remoting: Server encountered an internal error. - 阮 昨天忽然发现被加到training团队中了,遂来发一篇。 利用Brush修改图片,并写入Response一例(网上BBS中贴可变文字图片的例子)。 Avalon 与 3D。 关于QQ的临时消息 Google Search for dot net nuke. 初识 Avalon 通过程序控制Windows传真发送。 VRML Merry Chirstmas. 继续昨天的问题。 What's wrong? 构建安全的 ASP.NET 应用程序。(转) 检测Win Form Datagrid点击cell值的代码,from msdn。 Google search for DNN 终于写完了。 试了试Dot Net Nuke还真爽。 取得天气的WEB地址,weather.com 终于,从System.Windows.Forms.Control继承了一下。
DataGrid不能绑定Field?
· 2004-11-19 · via 博客园 - 阮

也许又是后之后觉,事情是这个样子地。

昨天看了看DNN,弄了个google search,今天,想把它完成,一定要用google的WSDL了,用wsdl.exe生成了一个C#代码,其中result里有一个ResultElement的数组,就要用datagrid绑它,呵呵,可以免去写分页的麻烦何乐而不为呢?

于是有了以下代码

                GoogleSearchService service = new GoogleSearchService();

                GoogleSearchResult result 
=  service.doGoogleSearch (ConfigurationSettings.AppSettings["GoogleKey"],
                    
this.queryTextBox.Text,
                    
0,
                    
10,
                    
false,
                    
"",
                    
false,
                    
"",
                    
"UTF-8",
                    
"UTF-8");

                
this.resultList.DataSource = result.resultElements;
                
this.resultList.DataBind();

绑定写成这样<%# DataBinder.Eval(Container.DataItem,"summary") %>

summary就是ResultElement的一个Field,怎么弄也弄不过去,无奈新建了一个工程试试该怎么绑

            this.resultList.DataSource = new TheElement[]{
                                                             
new TheElement(),
                                                             
new TheElement(),
                                                             
new TheElement(),
                                                             
new TheElement(),
                                                             
new TheElement(),
                                                             
new TheElement()
                                                         }
;
            
this.resultList.DataBind();

当TheElement类的定义是这样的时候,异常。

    public class TheElement
    
{
        
public string Hello = "hello";
    }

当TheElement类的定义改成这样的时候,OK。

    public class TheElement
    
{
        
public string Hello
        
{
            
get
            
{
                
return "Hello";
            }

        }

    }

搞不懂,为什么不让绑Field