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

ImageButton and server tags

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.