473,761 Members | 7,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Move a <Div> through vb code

Hi,

I have several <Div>'s that I have assigned an ID for. When the page loads
It set the Absolute Position through a Style sheet. Can I then reference the
<Div> through VB to move it to another Absolute. if so can you show me the VB
syntax.

Thanks
Mar 20 '06 #1
5 6976
I have several <Div>'s that I have assigned an ID for. When the page loads
It set the Absolute Position through a Style sheet. Can I then reference
the
<Div> through VB to move it to another Absolute. if so can you show me the
VB
syntax.


Unless you are writing the CSS via VB and are willing to reload the page to
see the change, then, no. If you want to move the div via client-side
interaction, then you need to use javascript.

-Darrel
Mar 20 '06 #2
Reloading is no problem. The Div needs to move as a result of a SQL response.
If I don't use a style sheet and just put the Div in the page can I do it?

Thanks for your quick response!

"Vear" wrote:
Hi,

I have several <Div>'s that I have assigned an ID for. When the page loads
It set the Absolute Position through a Style sheet. Can I then reference the
<Div> through VB to move it to another Absolute. if so can you show me the VB
syntax.

Thanks

Mar 20 '06 #3
You might be able to use the Panel control for that, since it creates a div.
Here's a little sample that uses a postback to change the position, size and
colour of the panel.

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
If Not IsPostBack Then
pnl1.Attributes .Add _
("style", "z-index: 101; left: 100px; width: 100px;" & _
" position: absolute; top: 100px; height: " & _
"100px;backgrou nd-color: green;")
End If
End Sub

Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
pnl1.Attributes .Add("style", "z-index: 101; left: 428px;" & _
" width: 100px; position: absolute; top: 112px;" & _
"height: 200px; background-color: yellow;")
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel id="pnl1" runat="server" Width="125px" Height="50px"
backcolor="Alic eBlue"> </asp:Panel>
<br />
<asp:button id="Button1" runat="server" onclick="Button 1_Click"
text="Button" /></div>
</form>
</body>
</html>
"Vear" <Ve**@discussio ns.microsoft.co m> wrote in message
news:9B******** *************** ***********@mic rosoft.com...
Hi,

I have several <Div>'s that I have assigned an ID for. When the page loads
It set the Absolute Position through a Style sheet. Can I then reference
the
<Div> through VB to move it to another Absolute. if so can you show me the
VB
syntax.

Thanks

Mar 20 '06 #4
That's perfect!!! Thank you so much. I've been trying to get this worked out
all weekend. I really appreaciate it.

John

"Ken Cox - Microsoft MVP" wrote:
You might be able to use the Panel control for that, since it creates a div.
Here's a little sample that uses a postback to change the position, size and
colour of the panel.

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
If Not IsPostBack Then
pnl1.Attributes .Add _
("style", "z-index: 101; left: 100px; width: 100px;" & _
" position: absolute; top: 100px; height: " & _
"100px;backgrou nd-color: green;")
End If
End Sub

Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
pnl1.Attributes .Add("style", "z-index: 101; left: 428px;" & _
" width: 100px; position: absolute; top: 112px;" & _
"height: 200px; background-color: yellow;")
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel id="pnl1" runat="server" Width="125px" Height="50px"
backcolor="Alic eBlue"> </asp:Panel>
<br />
<asp:button id="Button1" runat="server" onclick="Button 1_Click"
text="Button" /></div>
</form>
</body>
</html>
"Vear" <Ve**@discussio ns.microsoft.co m> wrote in message
news:9B******** *************** ***********@mic rosoft.com...
Hi,

I have several <Div>'s that I have assigned an ID for. When the page loads
It set the Absolute Position through a Style sheet. Can I then reference
the
<Div> through VB to move it to another Absolute. if so can you show me the
VB
syntax.

Thanks


Mar 20 '06 #5
Thanks for the reply, John... you made my day!

"Vear" <Ve**@discussio ns.microsoft.co m> wrote in message
news:B1******** *************** ***********@mic rosoft.com...
That's perfect!!! Thank you so much. I've been trying to get this worked
out
all weekend. I really appreaciate it.

John

"Ken Cox - Microsoft MVP" wrote:
You might be able to use the Panel control for that, since it creates a
div.
Here's a little sample that uses a postback to change the position, size
and
colour of the panel.

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
If Not IsPostBack Then
pnl1.Attributes .Add _
("style", "z-index: 101; left: 100px; width: 100px;" & _
" position: absolute; top: 100px; height: " & _
"100px;backgrou nd-color: green;")
End If
End Sub

Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
pnl1.Attributes .Add("style", "z-index: 101; left: 428px;" & _
" width: 100px; position: absolute; top: 112px;" & _
"height: 200px; background-color: yellow;")
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel id="pnl1" runat="server" Width="125px" Height="50px"
backcolor="Alic eBlue"> </asp:Panel>
<br />
<asp:button id="Button1" runat="server" onclick="Button 1_Click"
text="Button" /></div>
</form>
</body>
</html>
"Vear" <Ve**@discussio ns.microsoft.co m> wrote in message
news:9B******** *************** ***********@mic rosoft.com...
> Hi,
>
> I have several <Div>'s that I have assigned an ID for. When the page
> loads
> It set the Absolute Position through a Style sheet. Can I then
> reference
> the
> <Div> through VB to move it to another Absolute. if so can you show me
> the
> VB
> syntax.
>
> Thanks


Mar 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
13648
by: hitsmly | last post by:
Hi All! I used the following code to move a <div> in IE browser to the position of the mouse when I click on a link +div tag is: <div id=fm style="position:absolute; width:100px; height:100px; background:red">moving</div> and javascript code is: ...
3
1984
by: chris1606 | last post by:
I have an image gallery that pops up an enlarged version of a picture when someone clicks on it. That bit works, but it should also load the picture's caption into the floating layer. Instead the caption remains unchanged and gives an "object doesn't support this property or method" dialog. The code is as follows: <script> function goBig(objNo, caption) { document.getElementById('floatdiv').style.visibility = 'visible'; ...
2
2524
by: shivendravikramsingh | last post by:
hello friend,i m using this code<div id="get" style="visibility:hidden"><? include "time_title.php" ?></div> in a php page,i want when page load the inclued page time_tiltle.php should not shown,when i click a button,it should appear.but i don't no wat.s the prob. when i open the page it showing the content of timr_title.php,the <div> visibility is hidden.i call a function in a button in which i m setting the visibilty of <div> 'visible'.but it'...
2
2280
by: ShankerNair | last post by:
Howdy all, I would like to manipulate an HTML tag - a <div>, using ASP.NET, C# is the code behind. The tag would look something like this - <div id="divLime" style="visiblity:hidden"> <asp:Label ID="Label4" runat="server" Text="Student retreived from session :" Width="198px" Height="27px"></asp:Label> <asp:Label ID="Label6" runat="server" Height="27px" Style="z-index: 103; left: 197px; position: absolute; top: 0px"...
3
4627
by: lilOlMe | last post by:
I'm using Ajax to help make my webpage appear to be smoother. When a control has submitted, I would like to prevent any controls within that control from resubmitting until the request has completed. Because my forum has many buttons on it, it would take a long time to disable each one upon submitting the forum (using JavaScript). So instead, I plan on using a <div> that will "shield" my buttons and prevent the user from clicking any...
9
20194
by: saadkhan | last post by:
I`v made the following code: <div id="Panels" style="width: 28%;"> <asp:Panel ID="one" runat="server" CssClass="Panel"> <div id="Head" onclick="doToggle();"> HEADER </div> </asp:Panel> <asp:Panel ID="two" runat="server" CssClass="Content"> abcdefghijklmnopqrstuvwxyz
1
1850
by: saadkhan | last post by:
I`v made the following code: <div id="Panels" style="width: 28%;"> <asp:Panel ID="one" runat="server" CssClass="Panel"> <div id="Head" onclick="doToggle();"> HEADER </div> </asp:Panel> <asp:Panel ID="two" runat="server" CssClass="Content"> abcdefghijklmnopqrstuvwxyz
1
1938
by: gaya3 | last post by:
Hi All, In my dojo grid application, want to create <div> tag inside another <div> tag by using document.createElement('DIV'); I done as follows var outerNode = document.createElement('DIv'); outerNode .setAttribute('dojoType','dijit.Menu') document.body.appendChild(outerNode ); var innerNode1 = document.createElement('DIv'); innerNode1 .setAttribute('dojoType','dijit.MenuItem);
8
10047
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
10
5401
by: Manikrag | last post by:
Hi Team, I searched a lot on this but could not find anything, so I am posting it here. I am using an AutoCompleteExtender in a user control which is in a master page. The page layout is designed byDIV tags. My code in that user control is somehting like.. ---------------------------- <DIV> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:TextBox ID="TextBox1" runat="server" Width="160px"></asp:TextBox>
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.