Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# Fill HTML Input Text Box with value

Posted on 2011-03-08
1
Medium Priority
?
984 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
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

916 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