In an INPUT control, how can one set the initial text in a language-sensitive way ?

Discussion in 'ASP .Net' started by Radu, Jun 11, 2007.

  1. Radu

    Radu Guest

    Hi. I have an INPUT html control. How can I set the initial "select a
    value" type of text in a language-sensitive way ? I have the following
    HTML:

    <select
    class="input"
    id="cboSelectScorecardType" size="1"
    onfocus="previewFile(this)"
    onchange="previewFile(this)"
    style="width:400px;
    background-position: left top;
    background-attachment: scroll;
    background-repeat: repeat-x;"
    runat="server">
    <option><%$ Resources:Scorecards, String19 %></option>
    </select>

    It does not compile - it says
    Error 53 - Literal expressions like
    '<%$ Resources:Scorecards, String19 %>'
    are not allowed. Use
    <asp:Literal runat="server" Text="<%$ Resources:Scorecards,
    String19%>" />
    instead
    but I cannot have a literal control in there.....

    I have also tried with
    <option><%= Resources:Scorecards, String19 %></option>
    and with
    <option><%=GetGlobalResourceObject("Scorecards", "String18")%></
    option>,
    all with no success.

    How can one do this ? Thank you very much !
    Alex.
     
    Radu, Jun 11, 2007
    #1
    1. Advertising

  2. Hi

    <option runat=server Text="<%$ Resources:Scorecards, String19%>">
    </option>


    Does it work for you?

    -yuriy

    > Hi. I have an INPUT html control. How can I set the initial "select a
    > value" type of text in a language-sensitive way ? I have the following
    > HTML:
    >
    > <select
    > class="input"
    > id="cboSelectScorecardType" size="1"
    > onfocus="previewFile(this)"
    > onchange="previewFile(this)"
    > style="width:400px;
    > background-position: left top;
    > background-attachment: scroll;
    > background-repeat: repeat-x;"
    > runat="server">
    > <option><%$ Resources:Scorecards, String19 %></option>
    > </select>
    > It does not compile - it says
    > Error 53 - Literal expressions like
    > '<%$ Resources:Scorecards, String19 %>'
    > are not allowed. Use
    > <asp:Literal runat="server" Text="<%$ Resources:Scorecards,
    > String19%>" />
    > instead
    > but I cannot have a literal control in there.....
    > I have also tried with
    > <option><%= Resources:Scorecards, String19 %></option>
    > and with
    > <option><%=GetGlobalResourceObject("Scorecards", "String18")%></

    option>> ,
    option>>
    > all with no success.
    >
    > How can one do this ? Thank you very much !
    > Alex.
     
    Yuriy Solodkyy, Jun 11, 2007
    #2
    1. Advertising

  3. Radu

    Radu Guest

    On Jun 11, 3:31 pm, Yuriy Solodkyy <> wrote:
    > Hi
    >
    > <option runat=server Text="<%$ Resources:Scorecards, String19%>">
    > </option>
    >
    > Does it work for you?
    >
    > -yuriy
    >
    >
    >
    >
    >
    > > Hi. I have an INPUT html control. How can I set the initial "select a
    > > value" type of text in a language-sensitive way ? I have the following
    > > HTML:

    >
    > > <select
    > > class="input"
    > > id="cboSelectScorecardType" size="1"
    > > onfocus="previewFile(this)"
    > > onchange="previewFile(this)"
    > > style="width:400px;
    > > background-position: left top;
    > > background-attachment: scroll;
    > > background-repeat: repeat-x;"
    > > runat="server">
    > > <option><%$ Resources:Scorecards, String19 %></option>
    > > </select>
    > > It does not compile - it says
    > > Error 53 - Literal expressions like
    > > '<%$ Resources:Scorecards, String19 %>'
    > > are not allowed. Use
    > > <asp:Literal runat="server" Text="<%$ Resources:Scorecards,
    > > String19%>" />
    > > instead
    > > but I cannot have a literal control in there.....
    > > I have also tried with
    > > <option><%= Resources:Scorecards, String19 %></option>
    > > and with
    > > <option><%=GetGlobalResourceObject("Scorecards", "String18")%></

    >
    > option>> ,
    > option>>
    >
    >
    >
    > > all with no success.

    >
    > > How can one do this ? Thank you very much !
    > > Alex.- Hide quoted text -

    >
    > - Show quoted text -- Hide quoted text -
    >
    > - Show quoted text -


    Thank you, Yuryi !

    It works great, although.... hmmmmm.... it says "Internet Explorer 6 -
    Attribute TEXT is not a valid attribute of element Option".... but it
    works ! However, with VALUE instead of TEXT it works without any
    warnings - I guess IE silently translates TEXT=... to VALUE=...

    Thank you again very much !
    Alex
     
    Radu, Jun 11, 2007
    #3
    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. Kent P. Iler
    Replies:
    4
    Views:
    632
    =?Utf-8?B?bWF2aXNhaGRhcw==?=
    May 4, 2005
  2. Lovely Dola
    Replies:
    3
    Views:
    15,234
    Christian Kaufhold
    Dec 18, 2003
  3. Soso
    Replies:
    1
    Views:
    290
    Victor Bazarov
    Sep 26, 2007
  4. Avi
    Replies:
    2
    Views:
    650
    Arne Vajhøj
    Apr 12, 2008
  5. Kent P. Iler

    Can I set initial focus from server-side into textbox?

    Kent P. Iler, May 4, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    271
    mavisahdas
    May 4, 2005
Loading...

Share This Page