JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 13th, 2007, 06:44 AM
JamesF1982 JamesF1982 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 1 JamesF1982 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 19 m 36 sec
Reputation Power: 0
Making div visible and applying styles

Hey everyone,

Having some issues with some Javascript code within ASP.Net and wondered if anyone could help.

I am having trouble applying styles to a <div> called 'updateDiv' within my code.

What i would like to do is make the div visible upon a asp event which i have done. However i would like my Javascript function 'makeVisible()' to detect the browser width so it is positioned in the middle of the screen.

However, none of the styles i have tried applying in this function are applied to the div when it gets set to visible by an ASP event.

Can someone point me in the right direction please?

Many thanks,
James

Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="View4_Grid_View.ascx.cs" Inherits="JamesPlace_ASCX_View4_Grid_View" %>

<script type="text/javascript">
function makeVisible()
{
    var up = document.getElementById('updateDiv');
    up.style.width='100px';
    //var w = screen.availWidth * 0.5;
    //var h = screen.availHeight * 0.5;
    //var l = screen.availWidth * 0.25;
    //var t = screen.availHeigth * 0.25;
    //up.style.width = w;
    //up.style.left = l;     
}

</script>


<body onload="makeVisible()">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" 
    OnSorting="GridView1_OnSorting" AllowSorting="true" 
    OnRowCommand="GridView1_RowCommand" onrowediting="GridView1_RowEditing" 
     >
</asp:GridView>
<asp:Panel ID="Panel1" runat="server">
</asp:Panel>

<div runat="server" style="visibility:hidden" id="updateDiv">
            <table>
                <tr>
                    <td>
                        <asp:Panel ID="PanelEdit" runat="server">
                             <asp:Button ID="ButtonSave" runat="server" Text="Save" onclick="ButtonSave_Click" />
                             <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" onclick="ButtonCancel_Click" />
                        </asp:Panel>
                    </td>
                </tr>
            </table>
</div>
</body>

Last edited by colton22 : September 12th, 2007 at 12:24 PM. Reason: Please Use [CODE] Tags...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Making div visible and applying styles


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT