R
Ricky Li
I went through some article to see how I can add schema validation for
my templated control by adding an XSD file into the VS.NET schema
folder. Everything works fine for a schema like this:
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate>test</mytemplate>
</mycontrolns>
and I was able to specify the XSD to validate "mytemplate" as the only
valid child type for "mycontrol". Here's a challenge: Is there anyway
so that I can specify my XSD to make an asp:button with id being one
of a given set of valid values to be the only valid child type for
"mytemplate"? e.g.
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_valid_id"
runat="server"/></mytemplate>
</mycontrolns>
- will be validated by the XSD
and
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_invalid_id_not_listed"
runat="server"/></mytemplate>
</mycontrolns>
- will be invalidated by the XSD
I went through some article to see how I can add schema validation for
my templated control by adding an XSD file into the VS.NET schema
folder. Everything works fine for a schema like this:
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate>test</mytemplate>
</mycontrolns>
and I was able to specify the XSD to validate "mytemplate" as the only
valid child type for "mycontrol". Here's a challenge: Is there anyway
so that I can specify my XSD to make an asp:button with id being one
of a given set of valid values to be the only valid child type for
"mytemplate"? e.g.
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_valid_id"
runat="server"/></mytemplate>
</mycontrolns>
- will be validated by the XSD
and
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_invalid_id_not_listed"
runat="server"/></mytemplate>
</mycontrolns>
- will be invalidated by the XSD
Thanks!
my templated control by adding an XSD file into the VS.NET schema
folder. Everything works fine for a schema like this:
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate>test</mytemplate>
</mycontrolns>
and I was able to specify the XSD to validate "mytemplate" as the only
valid child type for "mycontrol". Here's a challenge: Is there anyway
so that I can specify my XSD to make an asp:button with id being one
of a given set of valid values to be the only valid child type for
"mytemplate"? e.g.
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_valid_id"
runat="server"/></mytemplate>
</mycontrolns>
- will be validated by the XSD
and
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_invalid_id_not_listed"
runat="server"/></mytemplate>
</mycontrolns>
- will be invalidated by the XSD
I went through some article to see how I can add schema validation for
my templated control by adding an XSD file into the VS.NET schema
folder. Everything works fine for a schema like this:
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate>test</mytemplate>
</mycontrolns>
and I was able to specify the XSD to validate "mytemplate" as the only
valid child type for "mycontrol". Here's a challenge: Is there anyway
so that I can specify my XSD to make an asp:button with id being one
of a given set of valid values to be the only valid child type for
"mytemplate"? e.g.
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_valid_id"
runat="server"/></mytemplate>
</mycontrolns>
- will be validated by the XSD
and
<mycontrolns:mycontrol id="test" runat="server">
<mytemplate><asp:button id="some_invalid_id_not_listed"
runat="server"/></mytemplate>
</mycontrolns>
- will be invalidated by the XSD
Thanks!