By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,028 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,028 IT Pros & Developers. It's quick & easy.

GetWebResourceUrl not working

P: n/a

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(WebReso urces.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(WebReso urces.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.

Aug 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<%#... %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
<ma*********@yahoo.comwrote in message
news:11*********************@g12g2000prg.googlegro ups.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(WebReso urces.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(WebReso urces.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.

Aug 2 '07 #2

P: n/a

Doh..

Thanks. Very stupid of me.
On 2 Aug, 17:16, "Teemu Keiski" <jot...@aspalliance.comwrote:
<%#... %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

<matt_ran...@yahoo.comwrote in message

news:11*********************@g12g2000prg.googlegro ups.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(WebReso urces.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(WebReso urces.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 -

Aug 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.