changing style from codebehind in .NET website

What am i doing wrong here... i want to change the position of a couple of items as per the code below. If the person is just a user (as opposed to an administrator) then i want to move the panel and gridview according to the positions below.

the gridview moves upwards from it's position to TOP = 150px
the panel moves left to position LEFT = 292
but the panel won't move up to position TOP = 16

what am i doing wrong there exactly?


'codebehind
If Session("Role") = "User" Then
            Panel2.Style.Add("TOP", "200")
            Panel2.Style.Add("LEFT", "292px")

            grdQueryStatus.Style.Add("TOP", "150px")

         End If

'html
<asp:Panel      ID="Panel2" runat="server" BorderStyle="Groove" Height="132px" Style="z-index: 113;
                        left: 556px; position: absolute; top: 60px" Width="336px"></asp:Panel>

<asp:GridView   ID="grdQueryStatus" runat="server" AllowPaging="True"
                        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
                        CellPadding="3" DataSourceID="AccessDataSource3" ForeColor="Black" GridLines="Vertical"
                        PageSize="20" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateSelectButton="True" style="z-index: 115; left: 11px; position: absolute; top: 233px" EnableViewState="False" Width="1300px"> <FooterStyle BackColor="#CCCCCC" />
                        <Columns></Columns>
                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>

Open in new window

AidenAAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

conrabaCommented:
I had a similar problem way back, Try adding "px" on the code behind declaration for top

Panel2.Style.Add("TOP", "200px")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AidenAAuthor Commented:
well done... didn't spot that at all... one of those little annoying ones!

Thanks! Aiden
0
AidenAAuthor Commented:
well done... didn't spot that at all... one of those little annoying ones!

Thanks! Aiden
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.