473,320 Members | 1,872 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,320 software developers and data experts.

Validating a 'HiddenField' control (on ASP 2.0)

Hi NG!

It seems to me that for some reason the validation objects don't know
how to work with controls of type 'HiddenField'.
It doesn't make any sence - because they are actually rendered as
<input type=hidden> on the client side, while regular textboxes that
rendered almost in the same way know how to be validated.

Any idea how to work-around this problem?

Eran Dvey-Aharon
ProSight Inc.
Nov 19 '05 #1
2 4865
I would go to lab.msdn.com and search for a prior bug that has been
filed about this. If you find one validate it and leave a comment (at the
bottom) and if you cannot find it then please post a new bug and then reply
to this tree with a link to it.

There have been multiple positions where Microsoft has decided to not
allow us to use or validate Hidden Input controls and I fail to see why they
continously decide to remove the Hidden fields from databinding and data
validation options.

"Eran Dvey-Aharon" <er**@prosight.com> wrote in message
news:ce**************************@posting.google.c om...
Hi NG!

It seems to me that for some reason the validation objects don't know
how to work with controls of type 'HiddenField'.
It doesn't make any sence - because they are actually rendered as
<input type=hidden> on the client side, while regular textboxes that
rendered almost in the same way know how to be validated.

Any idea how to work-around this problem?

Eran Dvey-Aharon
ProSight Inc.

Nov 19 '05 #2
Microsoft's validators only work when they have a webcontrol or Htmlcontrol
object declared and that object uses the ValidationPropertyAttribute. I
suspect that Microsoft engineers are concerned by a couple of things with
hidden fields:

1. Many users declare hidden fields through Page.RegisterHiddenField(). That
does not generate an object on the page. (Without an object, there is no
ValidationPropertyAttribute).
2. You can use a CustomValidator with a hidden field (only do not assign the
fieldID to the ControlToValidate property).

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

<jo*****@driver.net> wrote in message
news:eO**************@TK2MSFTNGP15.phx.gbl...
I would go to lab.msdn.com and search for a prior bug that has been
filed about this. If you find one validate it and leave a comment (at the
bottom) and if you cannot find it then please post a new bug and then
reply to this tree with a link to it.

There have been multiple positions where Microsoft has decided to not
allow us to use or validate Hidden Input controls and I fail to see why
they continously decide to remove the Hidden fields from databinding and
data validation options.

"Eran Dvey-Aharon" <er**@prosight.com> wrote in message
news:ce**************************@posting.google.c om...
Hi NG!

It seems to me that for some reason the validation objects don't know
how to work with controls of type 'HiddenField'.
It doesn't make any sence - because they are actually rendered as
<input type=hidden> on the client side, while regular textboxes that
rendered almost in the same way know how to be validated.

Any idea how to work-around this problem?

Eran Dvey-Aharon
ProSight Inc.


Nov 19 '05 #3

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

Similar topics

6
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
9
by: Kevin Blount | last post by:
Here's the code I tried, and found it failed... <form runat="server" method="post" name="CreditCardForm" id="CreditCardForm"> <% foreach (object item in Request.Form) { if...
3
by: sklett | last post by:
I've added a HiddenField control to my page and some javascript to show it's value in an alert box when a button is pressed. The value that is displayed in the alert box is correct, but when I...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 Below you see the code I'm having problem with. In the Open_Message event/method I want to get the value of the HiddenField at the row in the repeater control I clicked.... my...
1
by: Milkstr | last post by:
I have a repeating region with a hiddenfield on each line, i want to start a counter in my reapeating reagion so that the hiddenfield becomes unique on each line. So that is the reapeating region goe...
1
by: RSH | last post by:
I have a situation where I have a user control (Called TopOrangeMenu) that has an Hidden HTML Field called "txtU" I am trying to get at the value of that hidden field control from within the...
5
by: hharry | last post by:
Hello All, I am trying to make use the HiddenField server control to make a server-side variable visible to a client script. I set the value of the HiddenField inside of the Page_Load event. ...
7
by: imbirek8 | last post by:
Hi! I would like to write something in Javascript to HiddenField: <asp:HiddenField ID="hiddenMy" runat="server" Value="" /> And in the code behind read this value. But this HiddenField is in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.