Remove language attribute from HtmlInputButton

Discussion in 'ASP .Net Web Controls' started by Jonas, Oct 21, 2004.

  1. Jonas

    Jonas Guest

    Hi!

    I'm working with an ASP.NET web site that needs to conform with XHTML 1.0
    Transitional and got an ASP.NET HtmlInputButton which automatically adds the
    attribute language="javascript" which isn't allowed in XHTML. I've tried to
    remove this attribute by executing

    QuickSearchButton.Attributes["language"] = ""; or
    QuickSearchButton.Attributes["language"] = null; or
    QuickSearchButton.Attributes.Remove("language");

    in either Page_Load or QuickSearchButton_PreRender, but it does not work. I
    can add a new custom attribute, so I know that I can access the control.

    I found some postings about using a filter when outputting the response
    stream, but that seems to be overkill for just this issue. Before I start
    hacking away, I have some questions:

    1. Is it possible to build the control entirely from code-behind without
    a language attribute ?

    2. Could I perhaps use .RenderControl and filter the output there?

    3. Is there any other way to accomplish this?

    Brgds

    Jonas
     
    Jonas, Oct 21, 2004
    #1
    1. Advertising

  2. Hi Jonas,

    You might want to investigate this control to see if it ensures your output
    is valid:

    XHTML 1.0 Strict Filter

    http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=2266&tabindex=2

    "Jonas" wrote:

    > Hi!
    >
    > I'm working with an ASP.NET web site that needs to conform with XHTML 1.0
    > Transitional and got an ASP.NET HtmlInputButton which automatically adds the
    > attribute language="javascript" which isn't allowed in XHTML. I've tried to
    > remove this attribute by executing
    >
    > QuickSearchButton.Attributes["language"] = ""; or
    > QuickSearchButton.Attributes["language"] = null; or
    > QuickSearchButton.Attributes.Remove("language");
    >
    > in either Page_Load or QuickSearchButton_PreRender, but it does not work. I
    > can add a new custom attribute, so I know that I can access the control.
    >
    > I found some postings about using a filter when outputting the response
    > stream, but that seems to be overkill for just this issue. Before I start
    > hacking away, I have some questions:
    >
    > 1. Is it possible to build the control entirely from code-behind without
    > a language attribute ?
    >
    > 2. Could I perhaps use .RenderControl and filter the output there?
    >
    > 3. Is there any other way to accomplish this?
    >
    > Brgds
    >
    > Jonas
    >
    >
    >
     
    Ken Cox [Microsoft MVP], Oct 22, 2004
    #2
    1. Advertising

  3. Oops. Just realized that you had considered that option but found it overkill.


    "Jonas" wrote:

    > Hi!
    >
    > I'm working with an ASP.NET web site that needs to conform with XHTML 1.0
    > Transitional and got an ASP.NET HtmlInputButton which automatically adds the
    > attribute language="javascript" which isn't allowed in XHTML. I've tried to
    > remove this attribute by executing
    >
    > QuickSearchButton.Attributes["language"] = ""; or
    > QuickSearchButton.Attributes["language"] = null; or
    > QuickSearchButton.Attributes.Remove("language");
    >
    > in either Page_Load or QuickSearchButton_PreRender, but it does not work. I
    > can add a new custom attribute, so I know that I can access the control.
    >
    > I found some postings about using a filter when outputting the response
    > stream, but that seems to be overkill for just this issue. Before I start
    > hacking away, I have some questions:
    >
    > 1. Is it possible to build the control entirely from code-behind without
    > a language attribute ?
    >
    > 2. Could I perhaps use .RenderControl and filter the output there?
    >
    > 3. Is there any other way to accomplish this?
    >
    > Brgds
    >
    > Jonas
    >
    >
    >
     
    Ken Cox [Microsoft MVP], Oct 22, 2004
    #3
  4. Jonas

    Jonas Guest

    Hi and thanks for your answer.

    Yes, I found the filter but would rather not use that as I feel a bit
    uncomfortable with adding an extra layer of execution to all output just to
    get rid of the language attribute. I guess I'll have to rewrite the page so
    that it not uses the ASP.NET control.

    Brgds

    Jonas

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Oops. Just realized that you had considered that option but found it
    > overkill.
    >
    >
    > "Jonas" wrote:
    >
    >> Hi!
    >>
    >> I'm working with an ASP.NET web site that needs to conform with XHTML 1.0
    >> Transitional and got an ASP.NET HtmlInputButton which automatically adds
    >> the
    >> attribute language="javascript" which isn't allowed in XHTML. I've tried
    >> to
    >> remove this attribute by executing
    >>
    >> QuickSearchButton.Attributes["language"] = ""; or
    >> QuickSearchButton.Attributes["language"] = null; or
    >> QuickSearchButton.Attributes.Remove("language");
    >>
    >> in either Page_Load or QuickSearchButton_PreRender, but it does not work.
    >> I
    >> can add a new custom attribute, so I know that I can access the control.
    >>
    >> I found some postings about using a filter when outputting the response
    >> stream, but that seems to be overkill for just this issue. Before I start
    >> hacking away, I have some questions:
    >>
    >> 1. Is it possible to build the control entirely from code-behind
    >> without
    >> a language attribute ?
    >>
    >> 2. Could I perhaps use .RenderControl and filter the output there?
    >>
    >> 3. Is there any other way to accomplish this?
    >>
    >> Brgds
    >>
    >> Jonas
    >>
    >>
    >>
     
    Jonas, Oct 25, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonas
    Replies:
    0
    Views:
    375
    Jonas
    Oct 21, 2004
  2. Simon-Pierre  Jarry
    Replies:
    2
    Views:
    2,411
    Henrik
    Aug 10, 2005
  3. tshad
    Replies:
    6
    Views:
    21,531
    tshad
    Aug 8, 2006
  4. =?Utf-8?B?U0FM?=

    Using the HtmlInputButton

    =?Utf-8?B?U0FM?=, Nov 1, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    283
    =?Utf-8?B?U0FM?=
    Nov 1, 2006
  5. Anita C

    Htmlinputbutton

    Anita C, Aug 23, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    126
    Alvin Bruney
    Aug 24, 2003
Loading...

Share This Page