How modify <INPUT> value

V

VB Programmer

I have some hidden <INPUT> HTML fields in my ASPX page.

How do I modify the value (in VB.NET) based on a web.config appsettings
setting, such as ConfigurationSettings.Appsettings("MyValue")?

Here is the HTML field:
<input type="hidden" name="bn" value="PP-SubscriptionsBF"> <input
type="hidden" name="a3" value="XXXXXXXXX">

Thanks!
 
V

VB Programmer

Never mind, this is how I did it...
<input type="hidden" name="bn" value="PP-SubscriptionsBF"> <input>
type="hidden" name="a3" value="<%=MyValue%>">

Then I just set MyValue as a public var and set it to look at the
web.config.

Thanks! :)
 
M

MasterGaurav

Another way:

<input type="hidden" name="a3" id="a3">

And in CodeBehind:

Page_Load:
a3.Value = MyValue

Now, you don't need to make MyValue public. And if at all, you ever
need MyValue in aspx page, try making it just protected and not public.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top