Hi TS,
Yes, as Bruce has explained. The html form will always post those html
input fields via its "name" attribute. "ID" attribute is not used for
identifying form fields, it is used for client-side script language or DOM
model to reference each html element.
ASP.NET built-in use '$' char as control ID separator (for nested control
hierarchy). Are you adding hiddenfield inside some other control? If you
add it at page's top level, it should not contains such separator char.
Also, so far for the separator char, you can override ASP.NET Control
class's "IdSeparator" property to change it. However, changing it will
cause postback not work and here is a web article mentioned on this:
#The Odyssee of changing the idSeperator in Asp.net 2.0
http://code4ward.net/cs2/blogs/cmn/a...eeOfChangingTh
eIdSeperatorInAspNet2.aspx
Therefore, we should avoid changing this separator if possible.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "TS" <ma**********@nospam.nospam>
Subject: requestParams lists the name of the controls and not the ID
Date: Tue, 3 Jun 2008 08:26:38 -0500
>i am wondering why the name of the controls are listed in parameters of
request object instead of ID. The name always uses the default '$' for
encapsulations and the ID uses '_'. When i use
Page.ClientScript.RegisterHiddenField it renders the same value for name
and
>id, which is the '_' for both. This is causing my hidden fields to appear
in
>request context using '_' separators while all other controls use the '$'.
I have a framework of classes that rely on finding the '$' and interpret
'_'
>differently. Is there any way i can make
Page.ClientScript.RegisterHiddenField use $ for name value and keep ID as
'_'?
what other options do i have?
thanks