Hi Betty,
As for the "DataTargets" attribute, it is not a standard built-in server
control attribute(such as Textbox.Text ). I think it is a custom attribute
used by the developer to store some data (maybe it will be used by some
client-side script or used by some postback event later). For example, you
can also add your own custom attribute as below:
==============
<asp
ropDownList ID="DropDownList1" runat="server" DataTargets="ddd"
MyClientAttribute="some value" >
<asp:ListItem>aaa</asp:ListItem>
<asp:ListItem>bbb</asp:ListItem>
</asp
ropDownList>
==============
or you can even use code to add custom attribute
============
DropDownList1.Attributes.Add("my attribute","some data");
============
here is another thread ever discussed on the same topics:
#WebControl.Attributes.Add and custom attributes
http://bytes.com/groups/net-asp/595517-webcontrol-attributes-add-custom-attr
ibutes
If you have anything unclear, please feel free to post here.
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:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 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. 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/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?YzY3NjIyOA==?= <
[email protected]>
Subject: dataTargets in web control
Date: Tue, 10 Feb 2009 22:34:01 -0800
Hi all,
I saw in one of our *.aspx, there are some controls that have the following
format:
<div class="Cell">
<asp
ropDownList ID="ddlValidationType" runat="server"
CssClass="DropDown" Width="150px"
DataTargets="SelectedValue:[[ruleValidationTypeID(IntForDropDown)]]"
/>
</div>
Can someone tell what kind of grammer is this?
DataTargets="SelectedValue:[[ruleValidationTypeID(IntForDropDown)]]"
I googled a bit, didn't get any clue.
Thanks,