Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I make Validator : System.Web.UI.WebControls.CustomValidator

class.

and defined ValidationType property which is type of ValidateType.

I want to make the proerty is shown with Extended dropdown menu in properties window of Design mode.

I did following but, it doesn't show.

How can I do it?

 

using System;
using System.Web.UI; 
using System.ComponentModel;
namespace TestControls
{
/// <summary>
/// Summary description for Validator.
/// </summary>
[DefaultProperty("ValidationType")]
public class Validator : System.Web.UI.WebControls.CustomValidator
{
	public Validator()
	{
	}
	private ValidateType _validateType;
	[bindable(true), Browsable(true),
	Category("Appearance"),
	TypeConverter(typeof(ValidateType))]
	public ValidateType ValidationType
	{
		set
		{
			_validateType = value;
			switch(_validateType)
			{
				case ValidateType.Email:
					this.ClientValidationFunction="OnValidate_Email";
					this.ErrorMessage = "Test Error";
					break;
			}
		}
	}
}
}
using System;

namespace TestControls
{

public enum ValidateType
{
	Email = 1,
	Phone = 2,
}
}

Sun Certified Web component Developer,

Microsoft Certified Solution Developer .NET,

Software Engineer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...