By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,529 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,529 IT Pros & Developers. It's quick & easy.

Intellisense, schema validation for ASP.net custom templated control

P: n/a
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!
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.