Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Dynamically creating graphic and image map problem.

Reply
Thread Tools

Re: Dynamically creating graphic and image map problem.

 
 
Jacky Kwok
Guest
Posts: n/a
 
      08-14-2003
Stoitchko wrote:
> When I created the graph, I also created the image map
> which was associated with the graph. I stored the image
> map in a local variable. When the graph was ready I sent
> it.
>
> In the page that creates the graph
> Response.ContentType = "image/gif";
> b.Save(Response.OutputStream,ImageFormat.Gif);
>
> WebForm1.map_img = img_map.ToString();
>
>
> but how I can send the image map? I tried to use the
> literal control in the mane page for storing the image
> map and to set text property just before rendering but
> this doesn't work.
>
> This is in the main page
> <img src="img_gen.aspx" useMap="#map1">
> <asp:Literal id="Literal1" runat="server">
>
> and in code behind
> public static String map_img;
> private void InitializeComponent()
> {
> this.Literal1.Text = map_img;
>
> Many thanks for any advice you may have.
>
>


What is the exactly problem you encountered ?
I also use the same method in my application. I do not encounter problem.

Could you read the html source code in the web browser to know what is
the problem?

In my app, my code is

in the webform
//
<form id="Form1" method="post" runat="server">
<asp:Image id="ImageWorkspace" usemap="#CTRLMAP" runat="server"
ImageUrl="WorkSpaceImage.aspx"></asp:Image>
<asp:Literal id="LiteralImgMap" runat="server"></asp:Literal>
</form>

//
in the csharp source code
//
......
StringBuilder sb=new StringBuilder();
sb.Append("<MAP name=\"CTRLMAP\">");
sb.Append("<AREA SHAPE=\"RECT\" COORDS=\""+....
"\" HREF=\""+....
"\">");
.......
sb.Append("</MAP>");
LiteralImgMap.Text=sb.ToString();
.....


--
Jacky Kwok
http://www.velocityreviews.com/forums/(E-Mail Removed)
(E-Mail Removed)

 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      08-14-2003

"stoitchko" <(E-Mail Removed)> wrote in message
news:048d01c36252$e60f0450$(E-Mail Removed)...
> The problem is that I have 2 pages and I can't set the
> text property of the literal control which is in the
> first page from the second page which produces the graph
> and the image map.
>


You will always need two pages (at least): one for the html, the other
(wich will be called after the first has loaded into the browser)
for the image.

What you could do is this:
When constructing the first page, already build the image and imagemap.
Store the image in the Session and include the imagemap into the html.
The second page just reads the image from the session and
sends it to the browser.

Additional benefit:
On postback/refresh you can maybe avoid recalculating the image
and use the one in the Session.


Hans Kesting


 
Reply With Quote
 
 
 
 
stoitchko kalen
Guest
Posts: n/a
 
      08-14-2003

The problem is that I have 2 pages and I canít set the text property of
the literal control which is in the first page from the second page
which produces the graph and the image map




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically changing image map using XML data petethebloke@googlemail.com Javascript 7 06-08-2007 09:28 AM
Is it possible to mouseover a GRAPHIC . . . that launches another (freestanding) GRAPHIC (ie. when flash is _not_ available)? 50 SOMETHING GAL HTML 3 12-10-2006 01:10 AM
help needed with image map or creating a fancy java gui steven robinson Java 10 11-27-2003 09:58 AM
Re: USA Map Graphic Steve C. Orr, MCSD ASP .Net 0 08-05-2003 07:36 PM
Re: USA Map Graphic Chris Wilmot ASP .Net 0 08-05-2003 02:30 PM



Advertisments