Image with text inside

G

Guest

Hi everydoby!

I have an issue,

I have an static image, and I need to write text inside it in runtime, but I
don't know how! I can't use absolute position in atributtes style.

Thanks.
 
G

Guest

Thanks Eliyahu, I've already tried that, and It works fine on screen, but If
you want to print it, the image doesn't print, because IE has by default not
to print background images.

So, I can't use backgrounds, because I need to print the page.


Eliyahu Goldin said:
Set the image as the background in a control capable of accepting texts.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


albertosoria said:
Hi everydoby!

I have an issue,

I have an static image, and I need to write text inside it in runtime, but
I
don't know how! I can't use absolute position in atributtes style.

Thanks.
 
K

Kevin Spencer

If you put the image in a div, and set the dive to the size of the image,
and then add another div inside the first, under the image, and use relative
positioning and ZIndex, you can move it up over the image.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

albertosoria said:
Thanks Eliyahu, I've already tried that, and It works fine on screen, but
If
you want to print it, the image doesn't print, because IE has by default
not
to print background images.

So, I can't use backgrounds, because I need to print the page.


Eliyahu Goldin said:
Set the image as the background in a control capable of accepting texts.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


albertosoria said:
Hi everydoby!

I have an issue,

I have an static image, and I need to write text inside it in runtime,
but
I
don't know how! I can't use absolute position in atributtes style.

Thanks.
 
G

Guest

Thanks Kevin!

Finally, I've used a similar solution and it works.

I put the image in a div, but I put the labels inside as well, that is:

<div id="Image">
<asp:Image ID="Image_test" runat="server" ImageUrl="image_test.jpg" />
<asp:Label ID="Label1" runat="server" Text="MyText" style="left: 20px;
position: relative; height: 18px; top: -410px"></asp:Label>
</div>


In page_load I use:
Label1.Text = "Text I want to show"

And that's all, it works!


You can notice that the top atributte is "-410px", it makes the label appear
over the image.


Kevin Spencer said:
If you put the image in a div, and set the dive to the size of the image,
and then add another div inside the first, under the image, and use relative
positioning and ZIndex, you can move it up over the image.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

albertosoria said:
Thanks Eliyahu, I've already tried that, and It works fine on screen, but
If
you want to print it, the image doesn't print, because IE has by default
not
to print background images.

So, I can't use backgrounds, because I need to print the page.


Eliyahu Goldin said:
Set the image as the background in a control capable of accepting texts.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Hi everydoby!

I have an issue,

I have an static image, and I need to write text inside it in runtime,
but
I
don't know how! I can't use absolute position in atributtes style.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top