473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why all Female

ad

I convert the field to a template column and then use a tmeplate expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ? "Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)
Nov 17 '05 #1
10 1470
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ?
"Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #2
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ?
"Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #3
Very funny, however your reply did nothing to help the OP. Perhaps you can
demostrate your assertion by posting an 'Answer' which may help the OP?
--
OHM ( Terry Burns )

http://TrainingOn.net



"Stephany Young" <noone@localhost> wrote in message
news:ul****************@TK2MSFTNGP12.phx.gbl...
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ?
"Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)


Nov 17 '05 #4
Very funny, however your reply did nothing to help the OP. Perhaps you can
demostrate your assertion by posting an 'Answer' which may help the OP?
--
OHM ( Terry Burns )

http://TrainingOn.net



"Stephany Young" <noone@localhost> wrote in message
news:ul****************@TK2MSFTNGP12.phx.gbl...
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ?
"Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)


Nov 17 '05 #5
Ad,

Why don't you change it in your program to:
<%# (DataBinder.Eval(Container, "DataItem.SexID")).ToString()%>

Than you would see it in my opinion

Although woman are of course superior to man, should this not a reason that
they can do it without them.

Cor

Nov 17 '05 #6
Ad,

Why don't you change it in your program to:
<%# (DataBinder.Eval(Container, "DataItem.SexID")).ToString()%>

Than you would see it in my opinion

Although woman are of course superior to man, should this not a reason that
they can do it without them.

Cor

Nov 17 '05 #7
This is beecause the value is never "1". If it's a boolean item in the
dataset the response is probably "true" or "false" but don't rule out the
possibilities of "yes" or "no".

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ?
"Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #8
This is beecause the value is never "1". If it's a boolean item in the
dataset the response is probably "true" or "false" but don't rule out the
possibilities of "yes" or "no".

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ?
"Male":"Female"%>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #9
ad <ad@wfes.tcc.edu.tw> wrote:

I convert the field to a template column and then use a tmeplate expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ? "Male":"Female"%>

Why the value always equal Female


DataBinder.Eval (object, string) is an expression of type object, so
you're performing a reference identity comparison against the string
literal "1". If you use

"1".Equals(DataBinder.Eval (Container, DataItem.SexID"))
?"Male":"Female"

you may well find it works. Or not, depending on whether the evaluation
actually returns a string or not...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #10
ad <ad@wfes.tcc.edu.tw> wrote:

I convert the field to a template column and then use a tmeplate expression
like this:

<%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ? "Male":"Female"%>

Why the value always equal Female


DataBinder.Eval (object, string) is an expression of type object, so
you're performing a reference identity comparison against the string
literal "1". If you use

"1".Equals(DataBinder.Eval (Container, DataItem.SexID"))
?"Male":"Female"

you may well find it works. Or not, depending on whether the evaluation
actually returns a string or not...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ad | last post by:
I convert the field to a template column and then use a tmeplate expression like this: <%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ? "Male":"Female"%> Why the value always equal...
22
by: campbellbrian2001 | last post by:
Thanks in Advance! ... I have two textboxes: 1 is visible (and gets its value based on the invisible textbox and displays either "Male" or "Female", and needs to display either male of female based...
18
by: strangerdream | last post by:
I'm a lurker here, and I do not find any female regulars here in c.l.c. Is it something thats got to do with their genes?
0
by: smifti | last post by:
Any Pakistani (Region: Khi) Female Professional Web Designer who use Asp.Net using C#, Plz! contact me 03452884141. thanks & best regards smifti - khi
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.