Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to grant value to a html form hidden field

Reply
Thread Tools

How to grant value to a html form hidden field

 
 
David Jia
Guest
Posts: n/a
 
      10-16-2006
I have a html form in aspx pages, so how can I grant value to the hidden
field in this form?

For Example:

<body>
<script language="C#" runat="server">

string strTest = "test";
</script>

<form name="try" action="post" >
<input name="test1" type="hidden" />
</form>

How to make test1's value equals to strTest in C# script. Thank you very
much


 
Reply With Quote
 
 
 
 
Bruno Alexandre
Guest
Posts: n/a
 
      10-16-2006
that's not dot net

this is:


<script language="C#" runat="server">
string strTest = "test";

void Page_Load()
{
myHiddenField.value = strTest;
}
</script>

<body>
<form id="try" runat="server" >
<asp:hiddenfield runat="server" id="myHiddenField" />
</form>
</body>

--

Bruno Alexandre
K鴅enhavn, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/


"David Jia" <> wrote in message
news:%...
>I have a html form in aspx pages, so how can I grant value to the hidden
>field in this form?
>
> For Example:
>
> <body>
> <script language="C#" runat="server">
>
> string strTest = "test";
> </script>
>
> <form name="try" action="post" >
> <input name="test1" type="hidden" />
> </form>
>
> How to make test1's value equals to strTest in C# script. Thank you very
> much
>



 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      10-16-2006
"David Jia" <> wrote in message
news:%...

David,

Ignore Bruno's reply...

> How to make test1's value equals to strTest in C# script. Thank you very
> much


<input name="test1" type="hidden" value="<%=strTest%>" />


 
Reply With Quote
 
bruce barker \(sqlwork.com\)
Guest
Posts: n/a
 
      10-16-2006
or

ClientScript.RegisterHiddenField(name,value);

-- bruce (sqlwork.com)

"Mark Rae" <> wrote in message
news:ub8%...
> "David Jia" <> wrote in message
> news:%...
>
> David,
>
> Ignore Bruno's reply...
>
>> How to make test1's value equals to strTest in C# script. Thank you very
>> much

>
> <input name="test1" type="hidden" value="<%=strTest%>" />
>



 
Reply With Quote
 
David Jia
Guest
Posts: n/a
 
      10-16-2006
Thank you , the solution you offered works well, thanks a lot to you
again.!!
"Mark Rae" <> 写入消息新闻:ub8% bl...
> "David Jia" <> wrote in message
> news:%...
>
> David,
>
> Ignore Bruno's reply...
>
>> How to make test1's value equals to strTest in C# script. Thank you very
>> much

>
> <input name="test1" type="hidden" value="<%=strTest%>" />
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      10-16-2006
"David Jia" <> wrote in message
news:O$...

> Thank you , the solution you offered works well, thanks a lot to you
> again.!!


Welcome.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
Select box value changes value of hidden field dvwool@ix.netcom.com Javascript 6 04-27-2006 04:38 AM
A grant, a grant, my Pentax for a grant..... Pentax Fan Digital Photography 17 04-11-2006 03:28 AM
Pass hidden form field value to another form field to insert in db GavMc ASP General 4 09-22-2005 06:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57