473,408 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.DataItem( "exists" ) %>'>
</ItemTemplate>

Public txtExists As System.Web.UI.HtmlControls.HtmlInputHidden

Private Sub dgdAdvert_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
dgdAdvert.ItemCommand

dim exists as string

exists=txtExists.value

.......

I alays get nothing. Where is the problem?

Thank you,
Simon


Nov 18 '05 #1
3 7562
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.FindControl("txtExists"), TextBox).Tex

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

txtExists = (HTMLInputHidden) e.Item.FindControl("txtExists");

Av.

"simon" <si*********@stud-moderna.si> wrote in message
news:%2****************@tk2msftngp13.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.DataItem( "exists" ) %>'>
</ItemTemplate>

Public txtExists As System.Web.UI.HtmlControls.HtmlInputHidden

Private Sub dgdAdvert_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
dgdAdvert.ItemCommand

dim exists as string

exists=txtExists.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.Cells(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.FindControl("txtExists"), TextBox).Text

I think so.

Thank you,
Simon

"Mikael Gustafsson" <an*******@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.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.FindControl("txtExists"), 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
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...
6
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"...
7
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...
3
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...
0
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...
0
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...
11
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...
6
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 />"; ...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...
0
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...

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.