0
I have an Asp.net page that I need to get parameters from template HTML. I am trying the way below but I am not getting the values. Follow my code:
HTML - Template
<form method="post" action="http://localhost:61712/Default.aspx">
<TABLE>
<TBODY>
<TR>
<tdTEXT-ALIGN: center">
<p><font size="3"><b>Solicitacao Nr. %NUMSC% </b></font>
<input type="hidden" name="NumeroSC" value="%NUMSC%" />
</td>
</tr>
</tbody>
</table>
</form>
My page ASP.NET Default.aspx
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
protected void Page_Load(Object Src, EventArgs E)
{
string host = "******";
string usuario = "******";
string senha = "******";
string banco = "******";
var Compra = Request.Form["NumeroSC"];
string strSQL = "SELECT codigo as Numero, arquivo from MeuDatabase where codigo like '%Compra%'"; // é dessa forma que pego o parametro na string? Já tentei também + Compra +
SqlConnection conexao = new SqlConnection("Data Source=" + host + ";DATABASE=" + banco + ";UID=" + usuario + "; PWD=" + senha + ";");
conexao.Open();
...
When running my ASP.NET page, the page does not return any value for the query. I have tried it in HTML at value
pass an existing fixed value but also in my query does not return value.
What am I doing wrong? How can I get this parameter right %NUMSC%
?
EDIT
This form is not a Ubmit, it is a template. Every new request is mounted and filed an html, one for each request. My wish is that every html I open I call the Asp.net page with the information of that specific file number. Here’s how it works: an approving user receives an email with the link pointing to html (invoice). I wanted that when the user opened the link he would see the data that he already sees currently another "framezinho" embedded in this html that is a href pointing to the attachment(document) referring to that invoice. The point is, I can’t edit the code of the program that generates the invoice to already bring that information. So I saw the need to create an Asp.net page.
Hello. You check in the browser if the
value
input is set correctly. Also check if the form is being submitted to the page, as I have not seen any input to do Submit.– Joel Rodrigues
I already passed a value on the specific input but it still didn’t. This form is not a Ubmit, it’s a template. Each new request is mounted and archived with an html, one for each request. My wish is that every html I open I call the page Asp.net with information from that specific file number.
– PFVictor
I don’t understand. Define template. What is the execution flow? When this form is submitted?
– Caique C.
@Caiquec. there is a program that when the user completes the request is generated a tax note that is an HTML. I can’t touch the source code of this application. This code that I ran above is the standard template for the FY notes. What will change in each generated HTML is the Request Number and the other fields. So I have a blank HTML (template) and several others filled with your information (Multiple Tax Notes) When a new tax note is generated, I receive by email a link pointing to one of these respective html ready with the data.
– PFVictor
@Caiquec. What I need is to click and open the html I rescue in it data from this page Asp.net. What I’m trying to do first is to talk html to the Asp.net page to bring the other information I need to add to the invoice.
– PFVictor