• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 639
  • Last Modified:

ASP.NET issue displaying image button

I have a web page that dynamically creates an image button and displays it on my web page.  

When running the web app locally and on the prod servers (e.g. myserver.myweb.com) the image shows up with no problem.

When running the app via externally (e.g. www.mywebsite.com) the image dose not display.  I just get the red x.  It is only one button on one page that has this issue.

Any ideas?
0
CipherIS
Asked:
CipherIS
  • 6
  • 3
  • 2
  • +1
1 Solution
 
Vel EousResearch & Development ManagerCommented:
Are you certain the pathing is correct?
0
 
CipherISAuthor Commented:
yes.  The button displays when I call it by server.  It does not display when using the www.mywebsite.com.
0
 
mr-kennyCommented:
can you show the code?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
CipherISAuthor Commented:
Here is the code for the button.

<asp:ImageButton runat="server" id="btnBackToEvent" CausesValidation="false" 
ImageURL="~/img/Button.aspx?W=350&T=<&nbsp;Back to event&S=75" 
onclick="btnBackToEvent_Click" Visible="false"></asp:ImageButton><br />

Open in new window

0
 
Paul MacDonaldDirector, Information SystemsCommented:
...and "button.aspx" is some sort of retrieval page?  Do all the other images on the page use that to display?
0
 
mr-kennyCommented:
What is this site Button.aspx with these paramters (W=, T=, S=) doing?
0
 
CipherISAuthor Commented:
W = Width
T = Text
S = Scale

Its dynamically creating the button.  Every page uses the button.aspx.  Only having issues with 1 button.

Some of the code in the Button.aspx.cs page

Bitmap canvas = new Bitmap(btnWidth, btnHeight);
Graphics d = Graphics.FromImage(canvas);
Font btnFont = new Font("Arial", 14 * btnScaleF, FontStyle.Bold);

canvas = new Bitmap(btnWidth, btnHeight);
d = Graphics.FromImage(canvas);

d.DrawImage(btnF, 0, 0, btnWidth, btnHeight);
d.DrawImage(btnL, 0, 0, CapWidth, btnHeight);
d.DrawImage(btnR, btnWidth - (CapWidth), 0, CapWidth, btnHeight);

Open in new window

0
 
mr-kennyCommented:
what's this T=< brace doing here ?
0
 
CipherISAuthor Commented:
It is just printing the "<" char.  It is part of the text.
0
 
CipherISAuthor Commented:
fixed it.  deleted the "nbsp;"
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Is there a snowball's chance you'd be willing to share that button.aspx page?  It sounds like something I could use.

If it's proprietary, I understand.
0
 
CipherISAuthor Commented:
figured it out
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now