473,566 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageButton and server tags

I've got one that I've spent all to much time on:

I have an aspx page that includes the following (code behind is C#):

<asp:Imagebutto n runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

When rendered, the image src tag isn't there (at all!).

If I change to:

<asp:Imagebutto n runat="server" ImageUrl="appro ot/images/up.gif" />

the page is rendered just fine w/ the src attribute correctly set.

So, for some reason, when using the server tags, the src attribute isn't spit
out for some reason that is beyond me. The funny thing is that other similar
pages w/ similar tags all operate as expected.

Anyone have a clue?
Nov 18 '05 #1
3 1351
Hi Julie,

can u try this one ?
<asp:Imagebutto n runat="server" ImageUrl='<%# (string)
Application["AppPath"] +
"/images/up.gif" %>' />

Regards
Ashish M Bhonkiya
"Julie" <ju***@nospam.c om> wrote in message
news:40******** *******@nospam. com...
I've got one that I've spent all to much time on:

I have an aspx page that includes the following (code behind is C#):

<asp:Imagebutto n runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

When rendered, the image src tag isn't there (at all!).

If I change to:

<asp:Imagebutto n runat="server" ImageUrl="appro ot/images/up.gif" />

the page is rendered just fine w/ the src attribute correctly set.

So, for some reason, when using the server tags, the src attribute isn't spit out for some reason that is beyond me. The funny thing is that other similar pages w/ similar tags all operate as expected.

Anyone have a clue?

Nov 18 '05 #2
Ashish M Bhonkiya wrote:

Hi Julie,

can u try this one ?
<asp:Imagebutto n runat="server" ImageUrl='<%# (string)
Application["AppPath"] +
"/images/up.gif" %>' />
No difference, still doesn't render the src attribute.

Any other suggestions?

"Julie" <ju***@nospam.c om> wrote in message
news:40******** *******@nospam. com...
I've got one that I've spent all to much time on:

I have an aspx page that includes the following (code behind is C#):

<asp:Imagebutto n runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

When rendered, the image src tag isn't there (at all!).

If I change to:

<asp:Imagebutto n runat="server" ImageUrl="appro ot/images/up.gif" />

the page is rendered just fine w/ the src attribute correctly set.

So, for some reason, when using the server tags, the src attribute isn't

spit
out for some reason that is beyond me. The funny thing is that other

similar
pages w/ similar tags all operate as expected.

Anyone have a clue?

Nov 18 '05 #3
Hi Julie,

It seems that its not allowing to do it that way. After doing some research
i came to a conclusion
inside an <asp:xxx> tag, you're not really writing HTML per se, you're
writing child controls in this case we its adding a
'DataBoundLiter alControl' as a child to the existing control which is not
allowed.

Regards
Ashish M Bhonkiya

"Julie" <ju***@nospam.c om> wrote in message
news:40******** *******@nospam. com...
Ashish M Bhonkiya wrote:

Hi Julie,

can u try this one ?
<asp:Imagebutto n runat="server" ImageUrl='<%# (string)
Application["AppPath"] +
"/images/up.gif" %>' />


No difference, still doesn't render the src attribute.

Any other suggestions?

"Julie" <ju***@nospam.c om> wrote in message
news:40******** *******@nospam. com...
I've got one that I've spent all to much time on:

I have an aspx page that includes the following (code behind is C#):

<asp:Imagebutto n runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

When rendered, the image src tag isn't there (at all!).

If I change to:

<asp:Imagebutto n runat="server" ImageUrl="appro ot/images/up.gif" />

the page is rendered just fine w/ the src attribute correctly set.

So, for some reason, when using the server tags, the src attribute
isn't spit
out for some reason that is beyond me. The funny thing is that other

similar
pages w/ similar tags all operate as expected.

Anyone have a clue?

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2344
by: Michael Evanchik | last post by:
The following tag works fine in internet explorer, but in mozilla the image is not sized and left at its actualy size. Anyone know why? I though asp.net works on any browswer. <asp:imagebutton id="Image1" Runat="server" onclick="enteraccount" height="90" width="120" ImageUrl="images/account.gif" />
2
3631
by: Chuck Hartman | last post by:
I've been trying to add an ImageButton object to a Calendar table cell, but so far I am unable to handle the Command event from that button in my form's code behind. Below is an example of what I am trying to do. The ImageButton that is on the form handles its Command event just fine, but the ImageButton that is added to the cell does not...
3
6293
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, Tom.
2
4000
by: CJ Oakwood | last post by:
Morning - I am hoping somebody from this group can help me out here... I have been trying to add an array of ImageButtons to my WebForm however I keep getting an exception that I can't seem to find an answer for any where on the net. Any help in the right direction would be greatly appreciated. If more code/source is need please let...
13
7419
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif" runat="server"></asp:imagebutton></A> When the user sees these buttons, they will currently be on the savings.aspx?category=whatever page, and when they click another button to...
3
3904
by: jens.buchta | last post by:
Hi! I'm using a DataGrid with a template column to display an Image inside of it. I'm hooking into its OnPrerender-Event to set the ImageURL-Property dynamically. Everything works just fine here, until I thought "It would be cool, if the user could click on that image..". So I replaced the Image-Control with an ImageButton. My Problem...
3
3073
by: JuniorProgrammer | last post by:
Am trying to add an Image Button into a Datalist at Design time. When I run it it comes up with error: Server tag not well formed. It works perfectly when I add just an Image Control. Please help. <asp:DataList id="dlstframes" runat="server"> <ItemTemplate>
0
1818
by: Tom Edelbrok | last post by:
I'm using VS 2005 to develop an intranet asp.net web application and I get a weird situation. If I start out with any ASPX page that contains an ImageButton control followed by a TextBox control, everything works okay. I can press <ENTER> when the cursor is inside the text box and the page is running, and no events fire (this is what I...
4
1602
by: Benny Ng | last post by:
Dear All, <input type="checkbox" name="chkAgreement" value="0">I agree with the above terms and conditions <asp:ImageButton ID="ImgBtnSubmit" Runat="server" CausesValidation=True ImageUrl="images/submit.gif" width="70" height="30"></asp:ImageButton>
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.