472,805 Members | 1,049 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Intellisense, schema validation for ASP.net custom templated control

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
0 1087

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

Similar topics

5
by: Don | last post by:
Hi: I have created an xsd from my xml document. I pop this xsd in the following directory: C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml. That give me...
2
by: Earl Teigrob | last post by:
I have created a simple custom control that uses a table to create space around its contents. The code in the aspx page is show below. My problem is that the controls within the template can not be...
0
by: Earl Teigrob | last post by:
I have created a templated custom control that simply creates a spacing table around other objects. This control works fine for most uses but when I add it inside the ItemTemplate of a DataGrid...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
1
by: Frédéric Mayot | last post by:
Hi, I built a very simple templated user control but unfortunately, the template "Content" is not recognized by intellisense and it says that my component "SubForm" is not supposed to contain...
0
by: info | last post by:
Hi, Is it possible to include in the Schema validation file, every custom error message for each validation rules? This mean, in the same xsd file we can have the validation rules (patterns)...
1
by: Andrew Clancy | last post by:
Hi, Myself and a colleague are attempting to mimic the custom template functionality of the ASP.Net 2 Login control. Essentially, we would like to have the ability within our...
11
by: Nick Gilbert | last post by:
Hi, How can I create a custom control which will wrap its content in a header and footer? eg: Is it possible to create a .NET user control which can surround other controls? eg:...
7
by: Andrew Robinson | last post by:
I have an overridden control: public class DJGridView : GridView { } All works great except that I loose IntelliSense for all of the child elements while editing the HTML file from within...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.