Click here to Skip to main content
15,890,825 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP.NET Control Custom Attribute Pin
Not Active7-Apr-10 2:00
mentorNot Active7-Apr-10 2:00 
GeneralRe: ASP.NET Control Custom Attribute Pin
Ahmed Galal7-Apr-10 2:05
Ahmed Galal7-Apr-10 2:05 
GeneralRe: ASP.NET Control Custom Attribute Pin
Not Active7-Apr-10 2:43
mentorNot Active7-Apr-10 2:43 
GeneralRe: ASP.NET Control Custom Attribute Pin
Ahmed Galal7-Apr-10 3:01
Ahmed Galal7-Apr-10 3:01 
AnswerRe: ASP.NET Control Custom Attribute Pin
Arun Jacob7-Apr-10 2:10
Arun Jacob7-Apr-10 2:10 
GeneralRe: ASP.NET Control Custom Attribute Pin
Ahmed Galal7-Apr-10 2:14
Ahmed Galal7-Apr-10 2:14 
AnswerRe: ASP.NET Control Custom Attribute Pin
Arun Jacob7-Apr-10 2:19
Arun Jacob7-Apr-10 2:19 
AnswerRe: ASP.NET Control Custom Attribute [modified] Pin
Arindam Tewary7-Apr-10 2:47
professionalArindam Tewary7-Apr-10 2:47 
You can create your own text box control( a custom user control and can append the properties ) Is that you strictly want to write that in <asp:textbox>???

public partial class CustomTextBox : System.Web.UI.UserControl
{
    String sSampleData = String.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.sSampleData == "")
        {
            Page.Response.Write("No data set");
        }
        else
        {
            Page.Response.Write(this.sSampleData);
        }
    }
    public String MyAttribute
    {
        set { sSampleData = value; }
        get { return sSampleData; }
    }
}



<form id="form1" runat="server">
   <ADT:TextBox ID="aa" MyAttribute="Its working" runat="server" />
   </form>


1. The equivalent .NET class of <asp:textbox> is pre-written and you can not modify that. hence you can not add an extra "attribute" the way you have been trying to do.
2. When an attribute is added in following way

TextBox1.Attributes.Add("onclik","something");

it is added to rendered control's attribute collection.
These two attribute are different things. Thats why what you write in "design" view, after rendering you see different things.( asp:dropdownlist changes to select/option , asp:datagrid changes to <table > etc.
Thanks,
Arindam D Tewary
modified on Wednesday, April 7, 2010 9:13 AM

GeneralRe: ASP.NET Control Custom Attribute Pin
Ahmed Galal7-Apr-10 3:00
Ahmed Galal7-Apr-10 3:00 
QuestionInternal connection fatal error [modified] Pin
Hy Chanhan7-Apr-10 0:37
professionalHy Chanhan7-Apr-10 0:37 
AnswerRe: Internal connection fatal error Pin
Arindam Tewary7-Apr-10 3:18
professionalArindam Tewary7-Apr-10 3:18 
GeneralRe: Internal connection fatal error Pin
Hy Chanhan7-Apr-10 3:54
professionalHy Chanhan7-Apr-10 3:54 
AnswerRe: Internal connection fatal error Pin
Arindam Tewary7-Apr-10 4:15
professionalArindam Tewary7-Apr-10 4:15 
QuestionTransmit object through Web Service Pin
yu-jian6-Apr-10 21:49
yu-jian6-Apr-10 21:49 
AnswerRe: Transmit object through Web Service Pin
Brij6-Apr-10 23:08
mentorBrij6-Apr-10 23:08 
GeneralRe: Transmit object through Web Service Pin
yu-jian7-Apr-10 4:04
yu-jian7-Apr-10 4:04 
QuestionIs it a best practice to keep classes in different files all the time ? Pin
Nadia Monalisa6-Apr-10 20:45
Nadia Monalisa6-Apr-10 20:45 
AnswerRe: Is it a best practice to keep classes in different files all the time ? Pin
JHizzle6-Apr-10 22:38
JHizzle6-Apr-10 22:38 
GeneralRe: Is it a best practice to keep classes in different files all the time ? Pin
Nadia Monalisa6-Apr-10 22:44
Nadia Monalisa6-Apr-10 22:44 
AnswerRe: Is it a best practice to keep classes in different files all the time ? Pin
Arindam Tewary7-Apr-10 0:07
professionalArindam Tewary7-Apr-10 0:07 
QuestionNotifyIcon's Events do not work in windows service Pin
BK Komal6-Apr-10 20:18
BK Komal6-Apr-10 20:18 
GeneralRe: NotifyIcon's Events do not work in windows service Pin
Brij6-Apr-10 20:28
mentorBrij6-Apr-10 20:28 
QuestionAjax Tab Caontainer is not visible Pin
Masood Kochi,SSF6-Apr-10 20:10
Masood Kochi,SSF6-Apr-10 20:10 
QuestionPrinting MSChart in asp dot net Pin
Tufail Ahmad6-Apr-10 19:29
Tufail Ahmad6-Apr-10 19:29 
AnswerRe: Printing MSChart in asp dot net Pin
sashidhar6-Apr-10 20:43
sashidhar6-Apr-10 20:43 

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.