Change div sizes at runtime.

Hello,
I'm trying to change the height and width of some divs, at runtime, but I haven't had much luck so far.

this my source code

 <div id="divImgContainer" style="height: auto; width: 1000px; overflow-y: scroll; display: inline" runat="server">


           <div id="divImg" style="height: 900px; width: 640px; overflow: auto; float: left;" runat="server">

               <asp:UpdatePanel runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional" ID="upnlMainImage">
                   <ContentTemplate>
                       <asp:Image runat="server" ID="img"
                           ImageUrl=""
                           Height="900px" Width="640px" BorderStyle="Solid" BorderWidth="2px" BorderColor="Red"></asp:Image>
                   </ContentTemplate>
               </asp:UpdatePanel>
           </div>

           <div id="divResult" style="float: left;" runat="server">
               <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="upnlTicks" ChildrenAsTriggers="False">
                   <ContentTemplate>
                       <asp:Panel ID="pnlResult" runat="server" Height="900px" GroupingText="Mark Here" Width="320px">
                           <asp:Label ID="lblResults" runat="server" Text=""></asp:Label>
                           <asp:Repeater ID="rptResults" runat="server" OnItemCommand="rptResults_ItemCommand" OnItemDataBound="rptResults_ItemDataBound">
                               <ItemTemplate>
                                   <table class="nozoom" id="tblzoom" runat="server">
                                       <tr>
                                           <td>

Open in new window


I've tried

divImgContainer.Style.Add("height", "1200px");
Img.Style.Add("height", "1200px");
divResult.Style.Add("Height","1200px");

and using attributes

divImgContainer.Attributes.Add("style", "height: 1200px;");

Open in new window


The code above won't change anything. I'm wondering if it is an updatepanel issue???

Thanks!
Adrian CrossAsked:
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.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
can you provide generated HTML and the aspx source code?
0
Adrian CrossAuthor Commented:
Question edited.
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try something like this instead:

document.getElementById("divImgContainer").setAttribute("style", "height: 1200px;");
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Adrian CrossAuthor Commented:
Thanks, that did the trick!
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
coool, then you may proceed to close this question cheers
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
as proposed
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
ASP.NET

From novice to tech pro — start learning today.