带有DataBinder.Eval的模板化列中的带有skinID的Pb [英] Pb with skinID in templated columns having DataBinder.Eval

查看:85
本文介绍了带有DataBinder.Eval的模板化列中的带有skinID的Pb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我在一个带主题的页面中加载了一个usercontrol。


这个usercontrol包含带有超链接的列模板,带有skinID。


列没有显示,似乎有一些不可追踪

异常触发并且所有绑定都被停止。


但是同样命名的skinid正在为模板外的超链接工作。


这是一个有问题的问题吗?


谢谢你这是我的代码示例:


< asp :datagrid id =" myDataGrid" RUNAT = QUOT;服务器" width =" 100%"

AutoGenerateColumns =" False"的EnableViewState = QUOT假QUOT; AllowSorting =" True">

< Columns>

< asp:TemplateColumn>

< ItemTemplate>

< asp:HyperLink Text ="<%$ Resources:ResourcesGen,EDIT%>"

SkinID =" editHyperLink" NavigateUrl =''<%#

BuildUrl(Config.ModulesPath +" /Cont/ContEdit.aspx",PageNum," ItemNum =" +

DataBinder .Eval(Container.DataItem," ItemNum"))%>''Visible =''<%#IsEditable

%>''runat =" server" />

< / ItemTemplate>

< / asp:TemplateColumn>


解决方案

资源:ResourcesGen,EDIT%>"

SkinID =" editHyperLink" NavigateUrl =''<%#

BuildUrl(Config.ModulesPath +" /Cont/ContEdit.aspx",PageNum," ItemNum =" +

DataBinder .Eval(Container.DataItem," ItemNum"))%>''Visible =''<%#IsEditable

%>''runat =" server" />

< / ItemTemplate>

< / asp:TemplateColumn>


关于这个主题的更多信息,仍然没有解决方案:在第一个显示器上(PostBack

false)数据网格不显示,但由于更改而在回发上

在排序栏中,奇迹!显示所有内容!

作为补充,我添加了viewstate关闭网格和

Page_Load事件(在OnInit中设置委托,autoevenetwireup = false)

总是从数据库绑定数据网格。

只有sort事件才会生成seconjd绑定吗?我应该在回发时返回两次
绑定== false?


我不能让我的用户做回发:)?

可能是什么原因?


感谢您的帮助。

" WT" <WT@newsgroups.nospamaécritdansle message de news:
ua * *************@TK2MSFTNGP04.phx.gbl ...


您好,


我在一个带主题的页面中加载了一个usercontrol。


这个usercontrol包含带有超链接的列模板,带有skinID。


列没有显示,似乎有一些不可追踪的

异常触发并且所有绑定都被停止。


但是同样名为skinid正在为模板外的超链接工作。


这是一个难题吗?


感谢您的帮助。


CS


以下是我的代码示例:


< asp:datagrid id =" myDataGrid" RUNAT = QUOT;服务器" width =" 100%"

AutoGenerateColumns =" False"的EnableViewState = QUOT假QUOT; AllowSorting =" True">

< Columns>

< asp:TemplateColumn>

< ItemTemplate>

< asp:HyperLink Text ="<%


资源:ResourcesGen,EDIT%>"

SkinID =" editHyperLink" ; NavigateUrl =''<%#

BuildUrl(Config.ModulesPath +" /Cont/ContEdit.aspx",PageNum," ItemNum =" +

DataBinder .Eval(Container.DataItem," ItemNum"))%>''Visible =''<%#IsEditable

%>''runat =" server" />

< / ItemTemplate>

< / asp:TemplateColumn>



Hello,

I have a usercontrol loaded in a page with a theme.

This usercontrol contains columns template with hyperlinks, with skinID.

The columns are not displayed, seems thta there is some not traceable
exception triggered and the all binding is stopped.

But this same named skinid is working for hyperlinks outside templates.

Is it a knwn problem ?

Thanks for help.

CS

Here is a sample of my code:

<asp:datagrid id="myDataGrid" runat="server" width="100%"
AutoGenerateColumns="False" EnableViewState="False" AllowSorting="True">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink Text="<%$ Resources:ResourcesGen,EDIT %>"
SkinID="editHyperLink" NavigateUrl=''<%#
BuildUrl(Config.ModulesPath+"/Cont/ContEdit.aspx",PageNum,"ItemNum=" +
DataBinder.Eval(Container.DataItem,"ItemNum"))%>'' Visible=''<%# IsEditable
%>'' runat="server" />
</ItemTemplate>
</asp:TemplateColumn>


解决方案

Resources:ResourcesGen,EDIT %>"
SkinID="editHyperLink" NavigateUrl=''<%#
BuildUrl(Config.ModulesPath+"/Cont/ContEdit.aspx",PageNum,"ItemNum=" +
DataBinder.Eval(Container.DataItem,"ItemNum"))%>'' Visible=''<%# IsEditable
%>'' runat="server" />
</ItemTemplate>
</asp:TemplateColumn>



More on this subject, stillno solution: on the first display ( PostBack
false) the datagridrows are not display, but on the postback due to a change
in the sort column, miracle ! everything is displayed !
In complement I add that viewstate is off for the Grid and that in the
Page_Load event (set with a delegate in OnInit, and autoevenetwireup=false)
is always binding the datagrid from the DB.
Onlychange is thta the sort event generates a seconjd binding ? Should I
bind twice when postback==false ?

I can''t ask my users to do a postback :) ?
What could be the reason ?

Thanks for help.
"WT" <WT@newsgroups.nospama écrit dans le message de news:
ua**************@TK2MSFTNGP04.phx.gbl...

Hello,

I have a usercontrol loaded in a page with a theme.

This usercontrol contains columns template with hyperlinks, with skinID.

The columns are not displayed, seems thta there is some not traceable
exception triggered and the all binding is stopped.

But this same named skinid is working for hyperlinks outside templates.

Is it a knwn problem ?

Thanks for help.

CS

Here is a sample of my code:

<asp:datagrid id="myDataGrid" runat="server" width="100%"
AutoGenerateColumns="False" EnableViewState="False" AllowSorting="True">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink Text="<%


Resources:ResourcesGen,EDIT %>"
SkinID="editHyperLink" NavigateUrl=''<%#
BuildUrl(Config.ModulesPath+"/Cont/ContEdit.aspx",PageNum,"ItemNum=" +
DataBinder.Eval(Container.DataItem,"ItemNum"))%>'' Visible=''<%# IsEditable
%>'' runat="server" />
</ItemTemplate>
</asp:TemplateColumn>



这篇关于带有DataBinder.Eval的模板化列中的带有skinID的Pb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆