Solved

C# Fill HTML Input Text Box with value

Posted on 2011-03-08
1
960 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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