Solved

Force Uppercase in Label

Posted on 2006-11-28
4
871 Views
Last Modified: 2008-02-01
Hi,
I have a small question about formatting Label on an ASP.net page.

I use a sqldatasource to retrieve data from our oracle database,
on the page I put a datalist in which I bind the different fields returned by my query.

<asp:Label ID="CPLab" runat="server" Font-Bold="True" Font-Underline="True"
Text='<%# Eval("COMPANYNAME") %>' Font-Names="Times New Roman" Font-Size="11pt"></asp:Label>

One of the field comes from the database with the first letter in capital and others small.
I would like to force the label to display the whole field (all the letters) in uppercase.

By example, this give
Coca-cola -->COCA-COLA

and the same with lowercase
Thierry-->thierry

Acces databse gives ! to force uppercase, but I am unable to find the asp code.

thanks for your help
0
Comment
Question by:talentium
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
REA_ANDREW earned 125 total points
ID: 18027273
create a css class

.UpperCase
{
text-transform:uppercase;
}

apply this to your label and hey presto.
0
 

Author Comment

by:talentium
ID: 18030067
Thanks for your reply,

I try this solution, but don't get it work
meaning

in My aspx page, I try this without success :

<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Progress Report</title>

<style type="text/css">
.UpperCase
{
text-transform:uppercase;
}
</style>

</head>
<body>
<asp:Label ID="CPLab" runat="server" Font-Bold="True" Font-Underline="True"
Text='<%# Eval("COMPANYNAME") %>' Font-Names="Times New Roman" Font-Size="11pt" CssClass="uppercase"></asp:Label>
</body>
</html>



even with this
 <link rel="stylesheet" href="StyleSheet.css">

and putting your code in the css sheet

Any idea where I am wrong ?

Thanks
0
 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 18035015
you have this in your tag

uppercase

when your class is

UpperCase

Css Style attaching is case sensitive so the following will work.

<asp:Label ID="CPLab" runat="server" Font-Bold="True" Font-Underline="True"
Text='<%# Eval("COMPANYNAME") %>' Font-Names="Times New Roman" Font-Size="11pt" CssClass="UpperCase"></asp:Label>
0
 

Author Comment

by:talentium
ID: 18035637
Thanks, it works
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question