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

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - Render

数据绑定表达与javascript字符串连用 - Render - 博客园 手工删除打印任务 httpModules remove does not work in a folder or virtual directory 事件触发型ActiveX放置在网页中的部分思考 Javascript中文字符串处理额外注意事项 - Render - 博客园 Arc Catalog重建索引时报错:ORA-02298: 无法验证 (SDE.A18_FK1) - 未找到父项关键字 (A18_FK1) 指定web.config让httphandler处理某目录及子目录下所有文件 - Render - 博客园 windows命令行里取得年-月-日-时-分-秒的办法 - Render - 博客园 网站复杂信息自动录入处理 css中url的路径含义 ORACLE Transparent Gateway透明网关安装配置小问题 使用OLEDB访问ACCESS的几点经验 ARCIMS Serverlet Connector查询属性,当属性为中文时乱码处理 - Render [转载]ARCIMS 9.2 [ERR0134]错误解决方法 ORACLE 大数据表Update处理 PL/SQL developer的HomeEnd问题(转载) ArcSDE9.0对Oracle初始化参数的要求 在SDE中创建dataset时"Fail to Create, Cann't found spatial referrence entry"错 处理Oralce中非法的日期值
burrow在某些项目使用中报"控件包含代码块(即 <% ... %>),因此无法修改控件集合" - Render
Render · 2010-05-06 · via 博客园 - Render

burrow是NHibernate支持OpenSessionInViewer的一个框架,使用他的GenericDAO也很方便。但在某些WEB页面使用中会报"控件包含代码块(即 <% ... %>),因此无法修改控件集合",调用栈显示是NHibernate.Burrow.WebUtil.DLL!NHibernate.Burrow.WebUtil.Impl.GlobalPlaceHolder.p_PreRender处出错。

 处理办法可以:

下载burrow的源码,修改GlobalPlaceHolder.cs中的void p_PreRender(object sender, EventArgs e)函数,修改后为:

    void p_PreRender(object sender, EventArgs e)
        {
            if (IsInAjaxMode())
            {
                up.ContentTemplateContainer.Controls.Add(holder);
            }else {
                if(page.Form == null)
                    return; //for a page without form, there is no way to track status, and thus no need for this holder to be placed.
                //modified by Randy,the origin code:
                //page.Form.Controls.Add(holder);
               //下面的修改是处理在一些页面有<% %>时导致添加placeholder失败,这种情况下可以在页面的form中加:
                //<asp:PlaceHolder ID="NHibernate_Burrow_WebUtil_GlobalPlaceHolder" runat="server"></asp:PlaceHolder>
                //burrow会自动使用这个placeholder
                PlaceHolder existedHolder = page.FindControl(holderId) as PlaceHolder;
                if (existedHolder == null)
                {
                    page.Form.Controls.Add(holder);

                }
                else
                {
                    for (int i = holder.Controls.Count-1; i >=0 ; i--)
                    {
                        Control theControl=holder.Controls[i];
                        holder.Controls.Remove(theControl);
                        existedHolder.Controls.Add(theControl);
                    }                    
                    holder = existedHolder;
                }
            }
        }

同时修改 holder为非readonly修饰,把holderId修改为单词间用"_"连接。

 当然,也可以借这个小修改,一齐把burrow修改成支持NHibernate-2.1.2.GA的版本。