Professional Web Applications Themes

Injecting image page element without calling ASPX page? - ASP.NET General

I'm wondering if there's a solution here - I have an ASPX page with a sole purpose of scaling an image. The ASPX page contains a single line with the codebehind tag, and the .cs file contains the code to read an image, use GDI+ to scale it to a reasonable size, and emit the image directly (setting content-type on the response and spitting out the bytes for the image). What I'd love to do would be to eliminate the ASPX page and be able to call a routine in my compiled code directly. Since this code will be delivered ...

  1. #1

    Default Injecting image page element without calling ASPX page?

    I'm wondering if there's a solution here -

    I have an ASPX page with a sole purpose of scaling an image. The ASPX page
    contains a single line with the codebehind tag, and the .cs file contains
    the code to read an image, use GDI+ to scale it to a reasonable size, and
    emit the image directly (setting content-type on the response and spitting
    out the bytes for the image).

    What I'd love to do would be to eliminate the ASPX page and be able to call
    a routine in my compiled code directly. Since this code will be delivered to
    a customer, that would get rid of the extra ASPX page and make it much more
    elegant.

    But since the ASPX page is called in an "img" tag, I can't see a way to do
    this. Obviously, I need the img tag in the display file, but is there a way
    to specify that the content comes from code rather than another page? Can
    the img tag be runat-server and inject the image directly in codebehind?

    Anyone have a clue for me?

    Many thanks!

    Christopher


    Christopher Guest

  2. #2

    Default Re: Injecting image page element without calling ASPX page?

    "Christopher Ambler" <net> wrote in
    news:udV$4y$phx.gbl:
     

    I don't think so... because the browser needs to create a new connection to
    download the graphics image. The new connection would contain the binary
    image data. If you placed all the code on one page, the binary data would
    be mixed in with your html data, thus corrupting the display : (

    --
    Lucas Tam (com)
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Guest

  3. Moderated Post

    Default Re: Injecting image page element without calling ASPX page?

    Removed by Administrator
    Christopher Guest
    Moderated Post

Similar Threads

  1. Replies: 0
    Last Post: June 12th, 10:47 PM
  2. Controlling Page Access in .aspx page
    By Shawn Berg in forum ASP.NET Security
    Replies: 2
    Last Post: February 23rd, 01:56 PM
  3. Replies: 0
    Last Post: July 5th, 02:00 AM
  4. Replies: 0
    Last Post: July 4th, 09:24 PM
  5. Calling ASPX pages from ASP page
    By Lakshmi in forum ASP.NET General
    Replies: 1
    Last Post: June 25th, 06:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139