473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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(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
2 3660
<%#... %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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary | last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)"); This is not working ..what could be the...
6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
3
by: Jeremy Chapman | last post by:
Normally I would use GetWebResourceURL which would which would return the WebResources.axd url of a resource in my assembly. I would put that in my aspx and at run time the browser would do a get...
0
by: cruster | last post by:
Hey folks. I'm trying to achieve something like this within MasterPage code- behind: Page.ClientScript.RegisterClientScriptInclude("general", Page.ClientScript.GetWebResourceUrl(GetType(),...
1
by: Chris Auer | last post by:
I have one page that gets its contents from a class called FormBuilder.cs. It generates a web part. On that page GetWebResourceUrl works fine. All other pages generates an invalid assembly key. If...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.