title: How to pass values between .aspx form and .ashx handler
body: <p>I want to draw image, based on user input (width, height, etc...)</p>
  
  <p>I have my form in .aspx page, but i'm drawing image using ashx handler.</p>
  
  <p>I've got a code that draws image, but only from pre-assigned values.</p>
  
  <p>Now what i want to do is get values from my .aspx form</p>
  
  <p><strong>.aspx</strong></p>
  
  <pre><code>&lt;span&gt;Width&lt;/span&gt;
  &lt;asp:TextBox ID="input_width" Width="125" Text="600" runat="server" ClientIDMode="Static"&gt;&lt;/asp:TextBox&gt;&lt;br/&gt;
  &lt;span&gt;Height&lt;/span&gt;
  &lt;asp:TextBox ID="input_height" Width="125" Text="400" runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p><strong>.ashx.cs</strong></p>
  
  <pre><code>int width = 600;
  int height = 400;
  
  Bitmap bmp = new Bitmap(width, height);
  
  Graphics g = Graphics.FromImage((Image)bmp);
  g.FillRectangle(Brushes.Red, 0f, 0f, bmp.Width, bmp.Height);
  
  MemoryStream ms = new MemoryStream();
  bmp.Save(ms, ImageFormat.Png);
  
  byte[] bajt = ms.ToArray();
  
  context.Response.ContentType = "image/png";
  context.Response.BinaryWrite(bajt);
  context.Response.Flush();
  </code></pre>
  
  <p><strong>Already tried this</strong></p>
  
  <pre><code>string _width = context.Request.QueryString.Get("input_width.Text");
  
          int __width = Convert.ToInt32(_width);
  </code></pre>
  
  <p>But the value seems to be null</p>
  
  <p><strong>Some1 please help me?</strong></p>
  
  <p><strong>Thank you!</strong></p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>&lt;a href="ImageGen.ashx"&gt;Press here&lt;/a&gt;&lt;br /&gt;
          &lt;img src="ImageGen.ashx" width="600" height="400"/&gt;
  </code></pre>