473,377 Members | 1,119 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,377 software developers and data experts.

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:Imagebutton runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

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

If I change to:

<asp:Imagebutton runat="server" ImageUrl="approot/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 1339
Hi Julie,

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

Regards
Ashish M Bhonkiya
"Julie" <ju***@nospam.com> 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:Imagebutton runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

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

If I change to:

<asp:Imagebutton runat="server" ImageUrl="approot/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:Imagebutton runat="server" ImageUrl='<%# (string)
Application["AppPath"] +
"/images/up.gif" %>' />
No difference, still doesn't render the src attribute.

Any other suggestions?

"Julie" <ju***@nospam.com> 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:Imagebutton runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

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

If I change to:

<asp:Imagebutton runat="server" ImageUrl="approot/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
'DataBoundLiteralControl' as a child to the existing control which is not
allowed.

Regards
Ashish M Bhonkiya

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

Hi Julie,

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


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

Any other suggestions?

"Julie" <ju***@nospam.com> 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:Imagebutton runat="server" ImageUrl='<%# Application["AppPath"] +
"/images/up.gif" %>' />

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

If I change to:

<asp:Imagebutton runat="server" ImageUrl="approot/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
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. ...
2
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...
3
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, ...
2
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...
13
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"...
3
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...
3
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...
0
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,...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.