Click here to Skip to main content
15,913,027 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Ok, I'll be speciffic! I have a casting problem: Pin
minhpc_bk25-Jan-07 15:38
minhpc_bk25-Jan-07 15:38 
GeneralRe: Ok, I'll be speciffic! I have a casting problem: Pin
davidstern10025-Jan-07 17:19
davidstern10025-Jan-07 17:19 
QuestionUser controls and Custom controls Pin
Tina P24-Jan-07 13:12
Tina P24-Jan-07 13:12 
AnswerRe: User controls and Custom controls Pin
minhpc_bk24-Jan-07 13:57
minhpc_bk24-Jan-07 13:57 
GeneralRe: User controls and Custom controls Pin
Tina P25-Jan-07 11:37
Tina P25-Jan-07 11:37 
GeneralRe: User controls and Custom controls Pin
minhpc_bk25-Jan-07 14:33
minhpc_bk25-Jan-07 14:33 
GeneralRe: User controls and Custom controls Pin
Tina P26-Jan-07 6:46
Tina P26-Jan-07 6:46 
GeneralRe: User controls and Custom controls Pin
minhpc_bk26-Jan-07 17:47
minhpc_bk26-Jan-07 17:47 
Taking the AlternateText for an example, I want to demonstrate the way to implement that in a custom dropdownlist control. There are a couple of things that come to mind when I am investigating how to accomplish in pure HTML:
+ The DropDownList is a class in the ASP.NET and at the client side it is the Select html element.
+ So now that I look at the attributes, members of the Select element to see if it has the AlternateText (or Alt more exactly) attribute or any similar attribute, then I see that it has the similar one called Title. In case that nothing is found, you might widen your search to see if there is any other work-around to add this feature for the select element, for example put the select inside the div which supports the title attribute.
+ So once I know how to do in html, I now do that in ASP.NET and below is a simple custom control:

public class ExDropDownList : DropDownList
{
	[DefaultValue(""), Localizable(true), Bindable(true), Category("Appearance")]
	public virtual string AlternateText
	{
		get
		{
			string text1 = (string)this.ViewState["AlternateText"];
			if (text1 != null)
			{
				return text1;
			}
			return string.Empty;
		}
		set
		{
			this.ViewState["AlternateText"] = value;
		}
	}

	protected override void AddAttributesToRender(HtmlTextWriter writer)
	{
		base.AddAttributesToRender(writer);
                
		if (!string.IsNullOrEmpty(this.AlternateText))
		{
			writer.AddAttribute(HtmlTextWriterAttribute.Title, this.AlternateText);
		}
	}
}

I don't know off any particular article for dropdownlist, but you can do some search for that, for example this one[^]. Good luck!



GeneralRe: User controls and Custom controls Pin
Tina P27-Jan-07 18:18
Tina P27-Jan-07 18:18 
GeneralRe: User controls and Custom controls Pin
minhpc_bk28-Jan-07 19:04
minhpc_bk28-Jan-07 19:04 
GeneralRe: User controls and Custom controls Pin
Tina P29-Jan-07 18:33
Tina P29-Jan-07 18:33 
QuestionDeployment and Session State Pin
Andrew S. Kloos24-Jan-07 11:01
Andrew S. Kloos24-Jan-07 11:01 
AnswerRe: Deployment and Session State Pin
minhpc_bk24-Jan-07 14:04
minhpc_bk24-Jan-07 14:04 
Questionget the Documents and Settings directory Pin
Mack Ait-Aoudia24-Jan-07 10:38
Mack Ait-Aoudia24-Jan-07 10:38 
AnswerRe: get the Documents and Settings directory Pin
minhpc_bk24-Jan-07 14:45
minhpc_bk24-Jan-07 14:45 
Questionstring value Pin
netJP12L24-Jan-07 9:35
netJP12L24-Jan-07 9:35 
AnswerRe: string value Pin
Mack Ait-Aoudia24-Jan-07 10:55
Mack Ait-Aoudia24-Jan-07 10:55 
AnswerRe: string value Pin
Artem Kustikov25-Jan-07 0:55
Artem Kustikov25-Jan-07 0:55 
QuestionData Grid Control Pin
Civic0624-Jan-07 9:18
Civic0624-Jan-07 9:18 
AnswerRe: Data Grid Control Pin
ednrgc24-Jan-07 9:21
ednrgc24-Jan-07 9:21 
QuestionDynamic columns in Matrix report in Reporting services. Pin
kalyan_vb24-Jan-07 7:40
kalyan_vb24-Jan-07 7:40 
QuestionUsing OptGroup in DropDownList Pin
wEb GuRu...24-Jan-07 7:13
wEb GuRu...24-Jan-07 7:13 
AnswerRe: Using OptGroup in DropDownList Pin
minhpc_bk24-Jan-07 14:46
minhpc_bk24-Jan-07 14:46 
GeneralRe: Using OptGroup in DropDownList Pin
wEb GuRu...24-Jan-07 22:02
wEb GuRu...24-Jan-07 22:02 
GeneralRe: Using OptGroup in DropDownList Pin
minhpc_bk25-Jan-07 0:28
minhpc_bk25-Jan-07 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.