473,789 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

input type=hidden

I have input html control in my dataGrid.
When user click some button I would like to get it's value from codeBehind.

<ItemTemplate >
.......
<input type=hidden runat=server id="txtExists" value='<%#
Container.DataI tem( "exists" ) %>'>
</ItemTemplate>

Public txtExists As System.Web.UI.H tmlControls.Htm lInputHidden

Private Sub dgdAdvert_ItemC ommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
dgdAdvert.ItemC ommand

dim exists as string

exists=txtExist s.value

.......

I alays get nothing. Where is the problem?

Thank you,
Simon


Nov 18 '05 #1
3 7578
Try to use a <asp:TextBox id=txtExists runat=server visible=False value='...'> item instead of a <input type=hidden ...> object. Remove the declaration of the txtExists ant instead type the following in the ItemCommand function
Dim exists As String = CType(e.Item.Fi ndControl("txtE xists"), TextBox).Tex

This works for me!
Nov 18 '05 #2
hope you are doing this in ItemCommand just before accessing the txtExists
value.

txtExists = (HTMLInputHidde n) e.Item.FindCont rol("txtExists" );

Av.

"simon" <si*********@st ud-moderna.si> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I have input html control in my dataGrid.
When user click some button I would like to get it's value from
codeBehind.

<ItemTemplate >
.......
<input type=hidden runat=server id="txtExists" value='<%#
Container.DataI tem( "exists" ) %>'>
</ItemTemplate>

Public txtExists As System.Web.UI.H tmlControls.Htm lInputHidden

Private Sub dgdAdvert_ItemC ommand(ByVal source As Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
dgdAdvert.ItemC ommand

dim exists as string

exists=txtExist s.value

......

I alays get nothing. Where is the problem?

Thank you,
Simon

Nov 18 '05 #3
I found a solution wth <input type='hidden'>:
Dim exists As String = CType(e.Item.Ce lls(4).Controls (3),
HtmlInputHidden ).Value
If you have <asp:TextBox id=txtExists runat=server visible=False > then this
control is not rendered (because of visible=false)
so you can't read Dim exists As String =
CType(e.Item.Fi ndControl("txtE xists"), TextBox).Text

I think so.

Thank you,
Simon

"Mikael Gustafsson" <an*******@disc ussions.microso ft.com> wrote in message
news:7E******** *************** ***********@mic rosoft.com...
Try to use a <asp:TextBox id=txtExists runat=server visible=False value='...'> item instead of a <input type=hidden ...> object. Remove the
declaration of the txtExists ant instead type the following in the
ItemCommand function: Dim exists As String = CType(e.Item.Fi ndControl("txtE xists"), TextBox).Text
This works for me!

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10667
by: jason | last post by:
Can someone tell me if it is possible to store the contents of a TEXT AREA field in HIDDEN FIELD in another page after the initial form containing the textarea is submittted.... I need to do this to seamlessly present the submitted data in an attractive format while hiding his submitted data in the hidden field...but I am not sure if there are restrictions of eg 255 characters for a hidden field? Many thanks Jason
6
2064
by: Walter | last post by:
Hi, The user has to type his name into input a input field (type = text). This name must be passed to another ASP file. I did this but nothing happened: <form id=ins method="post" onsubmit="return doit()"> Type your name:<input id=txt1 type="text"> <INPUT id=smt TYPE="submit"> </form>
7
6750
by: Eduard Dewolf | last post by:
Hi, Im have been changing my site to make it HTML 4.01 compliant As I should, I wrapped all INPUT tags in blocks I wrapped the not visible INPUT type HIDDEN tags in first PRE, later H6 tags to comply to HTML 4.01, but this changes my layout severly In the upper right corner of http://www.dewolf.net, one can cahnge the language of the site.
3
4219
by: Michael Singer | last post by:
I wrote a simple testprogramm which renders a hidden input field. the value of this field is dynamically generated and filled with 100000 "z"'s --> "zzzzzzzzzzzzzzzzzzz..." and so on. if i call this page in IE and view the html source there are the 100000 z's
0
1172
by: yoshra | last post by:
i want to edit form and submit (post) it to another server. the name value contain char that cannot be inisde varible name in .net "xxx" so i gave those inputtypehidden diffrent name and diffrent id but when the html go to the client it change the name of inputtypehidden to the id also i am using user control so name is totally diffrent..
0
1118
by: Rotsey | last post by:
Hi, I have a application that fills a html hidden control with xml serverside. I use javascript to read the value of the control on the client. The problem is the value property is blank when using Firefox, ok in IE6. When I view the page source with Firefox I see the control and xml.
11
11804
by: captainmerton | last post by:
I am new to PHP but have been using it for about a week. I'm having no trouble using html forms to recall data from a MySQL table when the input type=text but i cant seem to find a way of recalling the data from the MySQL table when the input type=hidden. Here's the form code: <?php $action = $_REQUEST; $epic = $_REQUEST; ?> <TR> <TD>
6
2076
by: dba | last post by:
using the following code with a problem.... echo "<input type='hidden' name='member_id' value=\"{$row}\">{$row}"; echo "<input type='radio' name='member_name' value=\"{$row}\">{$row}<br />"; The post_data.php program posts the following member id is: 0009
1
3105
by: printline | last post by:
Hello All I'm quite new to xml vs. PHP, so i hope someone can help with an issue i have been struggeling with. I have an html form, that when submitted, it should create an xml file, and save in a certain place on my server. I know that this can be done using php, but i'm not sure how....? Here is my php (which needs to be configured to output the xml file):
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.