开发者

ASP.NET 2 Control Properties Databinding does not always work

开发者 https://www.devze.com 2023-03-14 03:13 出处:网络
I\'ve got the beautiful task at hand to look at some nic开发者_如何学Pythone legacy asp.net 2 code and implement some new controls.

I've got the beautiful task at hand to look at some nic开发者_如何学Pythone legacy asp.net 2 code and implement some new controls.

It's my first attempt at asp.net (the classic one, i've experimented with mvc a bit) so i am not too fond of it.

Right now i am trying to understand why a databinding sometimes works and a similar binding wont work on another page.

<asp:ImageButton ID="SaveAsPDFButton" runat="server" 
             ImageUrl='<%#GetPdfIconSmallPath() %>'
             ToolTip='<%$ Resources:SaveAsPDFButton.Text %>'
             CausesValidation="false" /> 

While the Tooltip gets evaluated and set, the ImageUrl of this control wont be set. The function is not getting executed. I've tried all, even disabling ViewState on it.

On other places, this same code however works just fine, like this small snippet here which does exactly what you might expect it to do:

<asp:HyperLink ID="InvHl" runat="server">
    <asp:Image ID="Img1" ImageUrl='<%#GetPdfIconSmallPath() %>' runat="server" />
</asp:HyperLink>

Same thing occurs with the Visible Property of an ASP:Panel i have on other places in this page.

Any ideas on how to get this working appreciated!


We didnt really solve the problem but switched to the newest version of ASP.NET which does not show such a strange behaviour.

0

精彩评论

暂无评论...
验证码 换一张
取 消