Re: Dynamically creating graphic and image map problem.

Discussion in 'ASP .Net' started by Jacky Kwok, Aug 14, 2003.

  1. Jacky Kwok

    Jacky Kwok Guest

    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

    Jacky Kwok, Aug 14, 2003
    #1
    1. Advertising

  2. Jacky Kwok

    Hans Kesting Guest

    "stoitchko" <> wrote in message
    news:048d01c36252$e60f0450$...
    > 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
    Hans Kesting, Aug 14, 2003
    #2
    1. Advertising

  3. 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!
    stoitchko kalen, Aug 14, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Wilmot

    Re: USA Map Graphic

    Chris Wilmot, Aug 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    383
    Chris Wilmot
    Aug 5, 2003
  2. Steve C. Orr, MCSD

    Re: USA Map Graphic

    Steve C. Orr, MCSD, Aug 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    361
    Steve C. Orr, MCSD
    Aug 5, 2003
  3. 50 SOMETHING GAL
    Replies:
    3
    Views:
    391
  4. Replies:
    5
    Views:
    1,597
    Anthony Jones
    Sep 12, 2008
  5. Replies:
    0
    Views:
    129
Loading...

Share This Page