Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

GetWebResourceUrl not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
matt_randle@yahoo.com - 02 Aug 2007 17:10 GMT
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.
Teemu Keiski - 02 Aug 2007 17:16 GMT
<%#... %> 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.

Signature

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

> Can anyone tell me why this is not working ?
>
[quoted text clipped - 18 lines]
>
> Please tell me im doing something stupid and its not a bug in asp.net.
matt_randle@yahoo.com - 02 Aug 2007 18:15 GMT
Doh..

Thanks.  Very stupid of me.

> <%#... %> refers to a databinbing exptression and you need to call
> control.DataBind() or Page.DataBind() for it to be evaluated.,
[quoted text clipped - 33 lines]
>
> - Show quoted text -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.