Solved

C# Fill HTML Input Text Box with value

Posted on 2011-03-08
1
969 Views
Last Modified: 2012-05-11
Hi Everyone,

Hopefullly someone can help. I've been trying to do this all day !

I have an online invoice system. Customer clicks on their invoice, and if it hasn't been paid yet it goes to a payment page.

It gives quick summary of the invoice and the amount and then customer clicks a pay now button and it goes through to paypal for the customer to pay online.

However, i cant get the amounts to pass through.

*************************************************************************************************

pay.aspx?number=xxxxxx   (Invoice Number)
_____________________________________


 <input type="hidden" name="cmd" value="_xclick" />
    <input type="hidden" name="business" value="pay@mysite.com" />
    <input type="hidden" name="currency_code" value="GBP" />
    <input type="hidden" name="return" value="returnhere.aspx" />
    <input type="hidden" name="no_note" value="1" />
    <input type="hidden" name="amount">
   <input type="hidden" name="item_name">

    Invoice Number:
    <asp:Label ID="LblInvoiceNumber" runat="server" Text="Label"></asp:Label>
        <br />
    Total Amount:  
    <br /><br />
        <asp:Button ID="PayNow" runat="server" Text="PAY NOW!" CausesValidation="False"
            PostBackUrl="https://www.paypal.com/cgi-bin/webscr" />

*************************************************************************************************

I want to fill 2 of the fields using a database connection.

The amount field and the item_name field.

Item_Name will need to be the invoice number, the amount will need to be the invoice amount.


Database fields.

Item_Name comes from InvoiceNumber
amount comes from InvoiceAmount

Any help would be greatly appreciated.

Many thanks!
0
Comment
Question by:jonpwatson5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 35072295
If you change the definition of those two field to:
    <input type="hidden" name="amount" ID="amount" runat="server" />
   <input type="hidden" name="item_name" ID="item_name" runat="server" />

Open in new window

They will then get wrapped as Html server controls and you will be able to access the from code-behind using:
    amount.Value = "some value";
    item_name.Value = "some other value";

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question