Search code examples
c#stylesheet

C# doesn't apply the correct style


i have a problem using a stylesheet in c# At the moment i am new with the whole c# thing and i am following some c# tutorials at youtube. Currently i am following this one: http://www.youtube.com/watch?v=rz81nV32700&list=PLi5N5AdsklLYeYo6dXbwR_bzXcLb_-3Ok&index=3

The following problem occurs, when i load data from my sql server this has to go in a table. I coded this as follow:

        foreach (test coffee in coffeeList)
        {
            sb.Append(
                string.Format(
                    @"<table class='coffeeTable'>
        <tr>
            <th rowspan='6' width='150px'><img runat='server' src='{6}' /></th>
            <th width='50px'>Name: </td>
            <td>{0}</td>
        </tr>

        <tr>
            <th>Type: </th>
            <td>{1}</td>
        </tr>

        <tr>
            <th>Price: </th>
            <td>{2} $</td>
        </tr>

        <tr>
            <th>Roast: </th>
            <td>{3}</td>
        </tr>

        <tr>
            <th>Origin: </th>
            <td>{4}</td>
        </tr>

        <tr>
            <td colspan='2'>{5}</td>
        </tr>           

       </table>",

as u can see i have a link for 'coffeeTable' wich has to link to my stylesheet, there u can find this piece of code:

.coffeeTable
{
width: 750px;
height: 250px;
margin: 10px 10px 10px 0;
border: 3px solid #E3E3E3;
border-radius: 10px;

}

.coffeeTable tr th, .coffeeTable tr td
{
text-align: right;
padding: 0px 5px 0 5px;
}

.coffeeTable img
{
padding: 0px 10px 10px 10px;
height: 150px;
width: 150px;
}

But when i run this project the style from my stylsheet doesn't apply. My stylesheet has different codes and when i use one i already used before then it works.

I have no idea what i am doing wrong so hopefully someone can help me here!


Solution

  • "Without examining the code - have you cleared the cache on your browser? Have you set your internet options to check for updates on every page visit? Hit control + F5 to force the browser to do a hard refresh. – user1666620 8 mins ago "

    This is the correct answer. Stupid that i didn't think of that myself! many thanks!