DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 02 Aug 2007 09:10:49 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    unknown
          2    Teemu Keiski
          3    unknown


GetWebResourceUrl not working   
Can anyone tell me why this is not working ?

I have an aspx page with the following definition,

<asp:ImageButton ID="MenuBtnOpen" ImageUrl='<%#
Page.ClientScript.GetWebResourceUrl(typeof(WebResources.Resource),
"A.gif")%>' />

When the page is processed by asp.net, the src attribute for the image
is always blank.

If I put this code in the Page_Load event,

MenuBtnOpen.ImageUrl =
Page.ClientScript.GetWebResourceUrl(typeof(WebResources.Resource),
"A.gif");

It works ok.

Ive spent an entire day trying to work this out.

Please tell me im doing something stupid and its not a bug in asp.net.
Date:Thu, 02 Aug 2007 09:10:49 -0700   Author:  

Re: GetWebResourceUrl not working   
<%#... %> refers to a databinbing exptression and you need to call 
control.DataBind() or Page.DataBind() for it to be evaluated., 
Page.DataBind() binds the entire page (also child controls) while 
control.dataBind() binds a specific control and its child controls.


-- 
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


 wrote in message 
news:1186071049.128207.66140@g12g2000prg.googlegroups.com...

>
> Can anyone tell me why this is not working ?
>
> I have an aspx page with the following definition,
>
> <asp:ImageButton ID="MenuBtnOpen" ImageUrl='<%#
> Page.ClientScript.GetWebResourceUrl(typeof(WebResources.Resource),
> "A.gif")%>' />
>
> When the page is processed by asp.net, the src attribute for the image
> is always blank.
>
> If I put this code in the Page_Load event,
>
> MenuBtnOpen.ImageUrl =
> Page.ClientScript.GetWebResourceUrl(typeof(WebResources.Resource),
> "A.gif");
>
> It works ok.
>
> Ive spent an entire day trying to work this out.
>
> Please tell me im doing something stupid and its not a bug in asp.net.
> 
Date:Thu, 2 Aug 2007 19:16:59 +0300   Author:  

Re: GetWebResourceUrl not working   
Doh..

Thanks.  Very stupid of me.


On 2 Aug, 17:16, "Teemu Keiski"  wrote:

> <%#... %> refers to a databinbing exptression and you need to call
> control.DataBind() or Page.DataBind() for it to be evaluated.,
> Page.DataBind() binds the entire page (also child controls) while
> control.dataBind() binds a specific control and its child controls.
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net
>
>  wrote in message
>
> news:1186071049.128207.66140@g12g2000prg.googlegroups.com...
>
>
>
>
>
> > Can anyone tell me why this is not working ?
>
> > I have an aspx page with the following definition,
>
> > <asp:ImageButton ID="MenuBtnOpen" ImageUrl='<%#
> > Page.ClientScript.GetWebResourceUrl(typeof(WebResources.Resource),
> > "A.gif")%>' />
>
> > When the page is processed by asp.net, the src attribute for the image
> > is always blank.
>
> > If I put this code in the Page_Load event,
>
> > MenuBtnOpen.ImageUrl =
> > Page.ClientScript.GetWebResourceUrl(typeof(WebResources.Resource),
> > "A.gif");
>
> > It works ok.
>
> > Ive spent an entire day trying to work this out.
>
> > Please tell me im doing something stupid and its not a bug in asp.net.- Hide quoted text -
>
> - Show quoted text -
Date:Thu, 02 Aug 2007 10:15:49 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us