473,795 Members | 3,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:my control id="test" runat="server">
<mytemplate>tes t</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:my control id="test" runat="server">
<mytemplate><as p:button id="some_valid_ id"
runat="server"/></mytemplate>
</mycontrolns>
- will be validated by the XSD

and

<mycontrolns:my control id="test" runat="server">
<mytemplate><as p:button id="some_invali d_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:my control id="test" runat="server">
<mytemplate>tes t</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:my control id="test" runat="server">
<mytemplate><as p:button id="some_valid_ id"
runat="server"/></mytemplate>
</mycontrolns>
- will be validated by the XSD

and

<mycontrolns:my control id="test" runat="server">
<mytemplate><as p:button id="some_invali d_id_not_listed "
runat="server"/></mytemplate>
</mycontrolns>
- will be invalidated by the XSD

Thanks!
Nov 18 '05 #1
0 1137

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

Similar topics

5
2162
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 intellisense when I specify the name space. But leaving hte namespace in messes up my transforms. Is there any way to get this intellisense functionality without adding the namespace all the time? Thanks,
2
1451
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 directly accessed from the code behind. In the code listing below, trying to use "Literal1" control in the code behind results in a null reference exception. How do I make the controls within my templated custom control accessible in the code...
0
1550
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 Control, Container.DataItem of the DataGrid control can no longer be access from within the template of my custom control. Is there a way to qualify the Container.DataItem object or some other method for me to access it from within my templated...
2
3737
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 all the messages to a message box (ShowMessageBox=true). The required field validation error messages show up in the summary just fine but I can't get the custom validation message to show up if invalid. So far I have the summary control...
1
2935
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 anything. Any idea ? Thanks SubForm.ascx------------------------- <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SubForm.ascx.cs" Inherits="SubForm" %>
0
2158
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) and the custom error message throw during validation for the end user. I know .NET enable it using errorMessage tag, but with a standard W3C java validation ... If is it possible, does it works in IE too? Like that the same XSD file could be...
1
3238
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 CompositeControl/CompositeControlDesigner to have and Action or Verb in the control's smart tag titled 'Convert to Template' which actually converts the whole control, including it's child controls to templated mode. Do this in the Login control, and you'll see...
11
3289
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: <my:RoundedCornerBox id=foo runat=server>
7
1704
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 VS2005. Any suggestions on what I could include within my control to enable this functionality? Thanks,
0
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.