I created a web form where a pdf file can be uploaded and displayed on the page. After this, there is a button where user will click and the pdf file will be inserted into the database table, at the same time redirect to another page. Upon loading the next
page, I want the saved PDF file to be called from the database and be displayed on the web page; a QR code will be created too for the PDF file. So that when the QR code is scanned, it will automatically redirect to the web page where the QR code and PDF file
displays. I have been trying to get this done for weeks without success.
Please can anyone help me out?
Here is what I tried
Table Schema
Id (int)
Email (nvarchar MAX)
Name (nvarchar MAX)
ContentType (navrchar MAX)
Data (varbinary MAX)
In the webforms below, PDF file is uploaded in Uploadinvoice.aspx, and the button is clicked to redirect to Invoiceprint.aspx where QR code will be generated in the page load event, and the PDF file will be displayed in Invoiceprint.aspx as well.
I get the binary data from database in the PDFprint.aspx webform and write it using html object tag with the help of Literal control. id is passed as parameter to the PDFprint.aspx webform for getting the record from database.
THE ISSUE: When it rediirects to the Invoiceprint.aspx webform, Nothing is displayed and the QR code will not generate too. May I ask for help to resolve this, maybe if there is another way of achieving this?
The error is extraordinarily clear. Are you reading the error? The querystring parameter "id" does not exist. That means the calling page did not add the querystring parameter. Rather than dumping all your code on the forum and forcing forum member to
weed through the logic, do a little troubleshooting to figure out why the "id" parameter is missing!
I did a search in your code and cannot find any redirect or link that calls Invoiceprint which is the Web Form that expects the "Id" parameter. The only redirect I found in the code is...
Response.Redirect("page2.aspx");
It looks like you need take a step back and review your code.
I'm so sorry about that; I shared the wrong codes and HTML. In my project, I have lots of webforms which I use to test before transferring to my main work, so I mistakenly shared from one of the test webforms.
I have modified the HTML and Codes in the thread, please check the right HTML and codes
I'm so sorry about that; I shared the wrong codes and HTML. In my project, I have lots of webforms which I use to test before transferring to my main work, so I mistakenly shared from one of the test webforms.
I have modified the HTML and Codes in the thread, please check the right HTML and codes
The only redirect in the updated code still does not have a querystring not does it point to the page with the error.
Response.Redirect("Invoiceprint.aspx");
I can't find any links to PDFPrint which throws the exception. I guess you still have not included the actual code? I recommend basic debugging to figure out why the "Id" is not passed. You should know what page you where on before receiving the error.
Member
66 Points
175 Posts
uploading PDF or word file and creating QR code for file
Nov 18, 2020 11:59 AM|georgeakpan233|LINK
Hello Forum,
I created a web form where a pdf file can be uploaded and displayed on the page. After this, there is a button where user will click and the pdf file will be inserted into the database table, at the same time redirect to another page. Upon loading the next page, I want the saved PDF file to be called from the database and be displayed on the web page; a QR code will be created too for the PDF file. So that when the QR code is scanned, it will automatically redirect to the web page where the QR code and PDF file displays. I have been trying to get this done for weeks without success.
Please can anyone help me out?
Here is what I tried
Table Schema
Id (int)
Email (nvarchar MAX)
Name (nvarchar MAX)
ContentType (navrchar MAX)
Data (varbinary MAX)
In the webforms below, PDF file is uploaded in Uploadinvoice.aspx, and the button is clicked to redirect to Invoiceprint.aspx where QR code will be generated in the page load event, and the PDF file will be displayed in Invoiceprint.aspx as well.
I get the binary data from database in the PDFprint.aspx webform and write it using html object tag with the help of Literal control. id is passed as parameter to the PDFprint.aspx webform for getting the record from database.
THE ISSUE: When it rediirects to the Invoiceprint.aspx webform, Nothing is displayed and the QR code will not generate too. May I ask for help to resolve this, maybe if there is another way of achieving this?
Here are my HTML and Codes
Uploadinvoice.aspx
Uploadinvoice.aspx.cs
PDFprint.aspx
Invoiceprint.aspx
Invoiceprint.aspx.cs
All-Star
53091 Points
23659 Posts
Re: uploading PDF or word file and creating QR code for file
Nov 18, 2020 02:02 PM|mgebhard|LINK
The error is extraordinarily clear. Are you reading the error? The querystring parameter "id" does not exist. That means the calling page did not add the querystring parameter. Rather than dumping all your code on the forum and forcing forum member to weed through the logic, do a little troubleshooting to figure out why the "id" parameter is missing!
I did a search in your code and cannot find any redirect or link that calls Invoiceprint which is the Web Form that expects the "Id" parameter. The only redirect I found in the code is...
It looks like you need take a step back and review your code.
Member
66 Points
175 Posts
Re: uploading PDF or word file and creating QR code for file
Nov 18, 2020 07:43 PM|georgeakpan233|LINK
Hi mgebhard,
I'm so sorry about that; I shared the wrong codes and HTML. In my project, I have lots of webforms which I use to test before transferring to my main work, so I mistakenly shared from one of the test webforms.
I have modified the HTML and Codes in the thread, please check the right HTML and codes
All-Star
53091 Points
23659 Posts
Re: uploading PDF or word file and creating QR code for file
Nov 18, 2020 08:15 PM|mgebhard|LINK
The only redirect in the updated code still does not have a querystring not does it point to the page with the error.
I can't find any links to PDFPrint which throws the exception. I guess you still have not included the actual code? I recommend basic debugging to figure out why the "Id" is not passed. You should know what page you where on before receiving the error.
Member
66 Points
175 Posts
Re: uploading PDF or word file and creating QR code for file
Nov 18, 2020 08:38 PM|georgeakpan233|LINK
I understand this. I'll look into it again.
Member
66 Points
175 Posts
Re: uploading PDF or word file and creating QR code for file
Nov 27, 2020 10:46 AM|georgeakpan233|LINK
Thanks mgebhard,
I finally got it. On button click, it will redirect to the page where the literal control will display the PDF file.
HTML for the redirected page
then in the redirected page load event, I have this code that displays the file as well as generate a QR code for the file