[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

.Net control style sheet question

Deanna Delapasse

2/25/2004 2:27:00 AM

Hi,

My asp.net DISABLED dropdownlist looks like this in the html :
<select name="DropDownList2" id="DropDownList2" disabled="disabled"
style="Z-INDEX: 101; LEFT: 64px; POSITION: absolute; TOP: 106px">
<option value="abcd">abcd</option>
<option value="efgh">efgh</option>
<option value="ijkl">ijkl</option>
<option value="mnop">mnop</option>
</select>

My default "select" style sheet entry works fine when the dropdownlist is
enabled, but when I disable it the font goes gray and becomes very hard to
read. Can I attach a style to the 'disabled' version of the control?

thanks,
Deanna


11 Answers

v-jetan

2/25/2004 7:48:00 AM

0


Hi Deanna,

Thank you for posting in the community!

Based on my understanding, you want to apply the style to disabled "select"
html tag.

=====================================
Actually, this can not be get done. For a html tag with disabled attribute,
it will become gray, and ignore any style attribute.
This is the behavior of html, but not the behavior of Asp.net.

Can you tell me why you want to disable the "select" html tag and also want
to apply style attribute on it ?

Maybe I can find some workaround for you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Deanna Delapasse

2/25/2004 12:29:00 PM

0


In some modes my screen is 'read-only', so I want the dropdownlist to
display, but not be editable. However, on some monitors it is very
difficult to read the disabled text. All I wanted was to change the
text to a darker color. I guess I can just hide the box and put up a
label. I just thought we should be able to override the style of the
'disabled' state.

thanks,
Deanna


*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

v-jetan

2/27/2004 3:12:00 AM

0


Hi Deanna,

Sorry for letting you wait for so long time.

Actually, when a html element is disabled, any style you applied to it will
not take effect, it will always become gray. This is by the design of the
Html behavior.

I think you want to disable the "select" html tag just to prevent the
dropdownlist to be select. And you just want the dropdownlist to be
readonly(Not selectable, I think this is what you said "not editable").
But, unfortunately, there is no "readonly" attribute for "select" html tag.

After doing a lot of research, the only workaround I can think of is using
other "can readonly" html tag to replace the "select" tag. You can get this
done through client javascript. For example, you can replace the "select"
html tag with readonly textbox(<input type=text>) or other suitable tag.

I wrote a sample below, in the sample, I use a "mutiple" one-size "select"
html tag(Which can not be drop down, so hehave like readonly) to replace
normal "select" tag:

<SELECT id="dropdownlist" style="Z-INDEX: 101; LEFT: 152px; WIDTH: 248px;
POSITION: absolute; TOP: 72px; HEIGHT: 136px"
name="dropdownlist">
<OPTION selected>asdfasd1</OPTION>
<OPTION>asdfasd2</OPTION>
<OPTION>asdfasd3</OPTION>
<OPTION>asdfasd4</OPTION>
<OPTION>asdfasd5</OPTION>
<OPTION>asdfasd6</OPTION>
</SELECT>

<script language="javascript">
function hidedropdownlist()
{
var so=document.createElement("select");
var op=document.createElement("option");

so.multiple=true;
so.size=1;
so.options.add(op);

so.options(0).text
=document.all("dropdownlist").item(document.all("dropdownlist").selectedInde
x).text;

so.style.position="absolute";

so.style.left= document.all("dropdownlist").style.left;
so.style.width=document.all("dropdownlist").style.width;
so.style.top=document.all("dropdownlist").style.top;

document.all("dropdownlist").style.visibility="hidden";

document.body.appendChild(so);
}
</script>

In the javascript code, I set the new-created "select" object's position
and size the same as original one. Then I hide the original
"dropdownlist"(select object).
Note:
1). You must apply "so.style.position="absolute"" to make the position is
absolute based.
2). You must apply "so.multiple=true" and "so.size=1" to make the
dropdownlist to be only one line(So can not be select and to be readonly)

You can invoke hidedropdownlist() at any client javascript event as you
like.

Btw: if you want to do this thing at server side(Such as in DropDownList
web control), you may use Page.RegisterClientScriptBlock to dynamicly
generate this code.

==========================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Have a nice day!!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

v-jetan

3/2/2004 12:58:00 AM

0


Hi Deanna,

Does my workaround make sense to you?

If you still have any concern, please feel free to tell me, I will help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Fred J. McCall

1/30/2009 8:15:00 PM

0

"B. Cramer" <bensalways@beltinghebes.com> wrote:

:
:"Fred J. McCall" <fjmccall@gmail.com> wrote in message
:news:3bi5o4he588goguiec3sn8d6gft6nbjjr9@4ax.com...
:> "Adam Whyte-Settlar" <ador@ble> wrote:
:> :
:> :By the way - I didn't plonk him because he's a nazi, like most people I
:> :plonked him because he's boring, breathtakingly ignorant and very, very
:> :stupid.
:> :
:>
:> And yet you devote vast amounts of time to talking about me. Your
:> output of articles would be much reduced if you indeed found me so
:> boring.
:>
:> You plonked me because you hate being show to be wrong.
:
:Nah. You're just a dull-witted shit, mccall. And as thick as suzie, the
:dyslexic, thick Irish cunt, cohen.
:

Poor little Ben Creamer. He's got to overcompensate because his
rubber truncheon is smaller than the other boys'.

Some day he'll realize that being insulted by an underachieving little
Nazi like him is considered complimentary by sane people.


--
"Der Feige droht nur, wo er sicher ist."
--Johann Wolfgang von Goethe

La N

1/30/2009 8:16:00 PM

0


"Josiah Jenkins" <josiah-jenkins@somewhere_else.invalid> wrote in message
news:ikl6o4d600hbeeefgpen34r533qid8ra6n@4ax.com...
> On Fri, 30 Jan 2009 18:36:36 GMT, "La N" <nilita2004NOSPAM@yahoo.com>
> wrote:
>
>>
>>"Adam Whyte-Settlar" <ador@ble> wrote in message
>>news:F_2dnZx_s9zqvh7UnZ2dnUVZ8vednZ2d@westnet.com.au...
>>>
>>> "conwaycaine" <conwaycaine@bellsouth.net> wrote in message
>>> news:8BEgl.3677$19.1440@bignews5.bellsouth.net...
>>>>
>>>> "Adam Whyte-Settlar" <ador@ble> wrote in message
>>>> news:oL2dnTjF8fsILB_UnZ2dnUVZ8sGdnZ2d@westnet.com.au...
>>>>> <deemsbill@aol.com> wrote in message
>>>>
>>>>> Fair enough.
>>>>> By the way - I didn't plonk him because he's a nazi, like most people
>>>>> I
>>>>> plonked him because he's boring, breathtakingly ignorant and very,
>>>>> very
>>>>> stupid.
>>>>
>>>> By using those standards you must have a very full
>>>> killfile................
>>>
>>> I do indeed.
>>
>>Conversely and ironically, Adam, I believe everybody reads *you*.
>> You have that certain je ne sais pas .....
>
> My French being restricted to a dozen or so words,
> was that some subtle insult ?
> Or should it have been, 'Je ne sais quoi' ?

Ooops ...you're right ... I think I did an auto-flame ... :)

- nilita


B. Cramer

1/30/2009 10:59:00 PM

0


"conwaycaine" <conwaycaine@bellsouth.net> wrote in message
news:yCEgl.3679$19.1392@bignews5.bellsouth.net...
>
> "B. Cramer" <bensalways@beltinghebes.com> wrote in message
> news:QvSdnWN6eZ6naB_UnZ2dnUVZ_sHinZ2d@giganews.com...
>> "Fred J. McCall" <fjmccall@gmail.com> wrote in message
>>> "Adam Whyte-Settlar" <ador@ble> wrote:
>>> :
>>> :By the way - I didn't plonk him because he's a nazi, like most people I
>>> :plonked him because he's boring, breathtakingly ignorant and very, very
>>> :stupid.
>>> :
>>>
>>> And yet you devote vast amounts of time to talking about me. Your
>>> output of articles would be much reduced if you indeed found me so
>>> boring.
>>>
>>> You plonked me because you hate being show to be wrong.
>>
>> Nah. You're just a dull-witted shit, mccall. And as thick as suzie, the
>> dyslexic, thick Irish cunt, cohen.
>
> Herr Kramer, aren't such public displays of affection verboten?
> The Party has very stringent rules, don't you know.


Which "party" might that be, silly little person?


B. Cramer

1/30/2009 11:00:00 PM

0


"Fred J. McCall" <fjmccall@gmail.com> wrote in message
news:fpn6o4t35c33rsato88rpg1368skc1f312@4ax.com...
> "B. Cramer" <bensalways@beltinghebes.com> wrote:
>
> :
> :"Fred J. McCall" <fjmccall@gmail.com> wrote in message
> :news:3bi5o4he588goguiec3sn8d6gft6nbjjr9@4ax.com...
> :> "Adam Whyte-Settlar" <ador@ble> wrote:
> :> :
> :> :By the way - I didn't plonk him because he's a nazi, like most people
> I
> :> :plonked him because he's boring, breathtakingly ignorant and very,
> very
> :> :stupid.
> :> :
> :>
> :> And yet you devote vast amounts of time to talking about me. Your
> :> output of articles would be much reduced if you indeed found me so
> :> boring.
> :>
> :> You plonked me because you hate being show to be wrong.
> :
> :Nah. You're just a dull-witted shit, mccall. And as thick as suzie, the
> :dyslexic, thick Irish cunt, cohen.
> :
>
> Poor little Ben Creamer. He's got to overcompensate because his
> rubber truncheon is smaller than the other boys'.

Oh dear. Poor little mcCall really thinks he's of some importance.

More delusions of adequacy on display from the Irish wanker.


Fred J. McCall

1/31/2009 2:58:00 AM

0

"conwaycaine" <conwaycaine@bellsouth.net> wrote:
:
:"B. Cramer" <bensalways@beltinghebes.com> wrote in message
:news:QvSdnWN6eZ6naB_UnZ2dnUVZ_sHinZ2d@giganews.com...
:> "Fred J. McCall" <fjmccall@gmail.com> wrote in message
:>> "Adam Whyte-Settlar" <ador@ble> wrote:
:>> :
:>> :By the way - I didn't plonk him because he's a nazi, like most people I
:>> :plonked him because he's boring, breathtakingly ignorant and very, very
:>> :stupid.
:>> :
:>>
:>> And yet you devote vast amounts of time to talking about me. Your
:>> output of articles would be much reduced if you indeed found me so
:>> boring.
:>>
:>> You plonked me because you hate being show to be wrong.
:>
:> Nah. You're just a dull-witted shit, mccall. And as thick as suzie, the
:> dyslexic, thick Irish cunt, cohen.
:
:Herr Kramer, aren't such public displays of affection verboten?
:The Party has very stringent rules, don't you know.
:

I just think it's rather telling that I say something to Asshat
White-Settler and get the reply from Ben Creamer, the naked Nazi.

I think little Ben's problem is that he has truncheon envy...


--
"Oooo, scary! Y'know, there are a lot scarier things
in the world than you ... and I'm one of them."

-- Buffy the vampire

Fred J. McCall

1/31/2009 3:10:00 AM

0

"La N" <nilita2004NOSPAM@yahoo.com> wrote:

:
:"Adam Whyte-Settlar" <ador@ble> wrote in message
:news:F_2dnZx_s9zqvh7UnZ2dnUVZ8vednZ2d@westnet.com.au...
:>
:> "conwaycaine" <conwaycaine@bellsouth.net> wrote in message
:> news:8BEgl.3677$19.1440@bignews5.bellsouth.net...
:>>
:>> "Adam Whyte-Settlar" <ador@ble> wrote in message
:>> news:oL2dnTjF8fsILB_UnZ2dnUVZ8sGdnZ2d@westnet.com.au...
:>>> <deemsbill@aol.com> wrote in message
:>>
:>>> Fair enough.
:>>> By the way - I didn't plonk him because he's a nazi, like most people I
:>>> plonked him because he's boring, breathtakingly ignorant and very, very
:>>> stupid.
:>>
:>> By using those standards you must have a very full
:>> killfile................
:>
:> I do indeed.
:>
:
:Conversely and ironically, Adam, I believe everybody reads *you*. You have
:that certain je ne sais pas .....
:

Sort of the same reason everyone looks at car wrecks and doesn't turn
their back on the lunatic in the room....


--
"Ordinarily he is insane. But he has lucid moments when he is
only stupid."
-- Heinrich Heine