I am passing the following via the request object in codeBehind:
Get the Requested code to be created.
Dim Code As String = Request("code").ToString()
and below is my markup page called barcodes.aspx:
<form id="Form1" method="post" runat="server">
<img src="barcodes.aspx?code=XXXXX" alt="barcode" />
<asp:Image id="myBarCode" runat="server"></asp:Image>
</form>
Why am I getting the error above?
You need to actually submit the form (POST) or pass the parameters in the URL (GET) to get the request parameters via the Request object. Two easy ways (of many) to do this:
Option 1. Keep just your
barcodes.aspxandbarcodes.aspx.vb. Inbarcodes.aspxput:In
barcodes.aspx.vbput in thePage_Load:Then just hit the submit button on your aspx page.
Option 2. Split it into two aspx pages but basically same as above.
In
submitme.aspxput this (for a POST, click the button):Or this (for a GET, click the link):
In
barcodes.aspx.vbput this in Page_Load (works for either the GET or POST option):In
barcodes.aspxyou would then simply need: