473,655 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

positioning of html and aspx elements

Thanks for any help folks:

I have two .aspx pages that are workling well: one is for entering
entries in a blog and another for viewing those entries. What I want
to do is combine the two into one so I have a textbox and submit
button at the top and the blog entries below. Any ideas?
Here is my entry page:
<%@ import Namespace="Syst em.Data" %>
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Using ds As New DataSet()
ds.ReadXml(Serv er.MapPath("blo g.xml"))
txtNewEvent.Dat aBind()
txtDate.DataBin d()
End Using
End If
End Sub
Private Sub btnSubmit_Click (ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles btnSubmit.Click
Using ds As New DataSet()
ds.ReadXml(Serv er.MapPath("blo g.xml"))
Dim dr As DataRow = ds.Tables(0).Ne wRow()
dr("entry") = txtNewEvent.Tex t
dr("name") = txtDate.Text
ds.Tables(0).Ro ws.Add(dr)
ds.WriteXml(Ser ver.MapPath("bl og.xml"))
Response.Redire ct("http://site.com/Default.aspx")
End Using
End Sub
Protected Sub Button1_Click(B yVal sender As Object, ByVal e As
System.EventArg s)
Response.Redire ct("http://site.com/Default.aspx")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Blog Entry</title>
<style type="text/css">
#Form1
{
height: 508px;
width: 727px;
}
</style>
</head>
<body background="vig nette.gif" runat="server">
<a href="javascrip t:my_win()"></a<form id="Form1" method="post"
runat="server">

<b>
<a href="/demos/books.xml"></a>
<asp:Label ID="Label2" runat="server" BackColor="#00C 0C0" Font-
Bold="True" Font-Size="Large"
Text="Enter your comments into our blog:" Width="375px"
BorderStyle="Ou tset"></asp:Label>
<asp:TextBox ID="txtNewEvent " runat="server" Width="451px"
Height="212px"
style="padding-right: 5%; padding-left: 5%; padding-bottom:
5%; margin: 5%; padding-top: 5%"
TextMode="Multi Line"></asp:TextBox>

<asp:Button ID="btnSubmit" runat="server" Text="Submit"
OnClick="btnSub mit_Click" /></b><br />
<asp:Label ID="Label1" runat="server" BackColor="#00C 0C0"
Font-Bold="True" Text="Your Name" BorderStyle="Ou tset"></asp:Label>
<asp:TextBox ID="txtDate" runat="server" Width="266px"></
asp:TextBox>
<p>
<b>
<asp:Button ID="Button1" runat="server" BackColor="Aqua "
Style="z-index: 107; left: 750px;
position: absolute; top: 488px; font-weight: 700; width:
168px;"
Text="Home" onclick="Button 1_Click" />
</b></p>
<p>
</p>
</form>
</body>
</html>
Here is my viewing page:
<%@ import Namespace="Syst em.Data" %>
<script runat="server">
Private Function MakeDataView() as DataView
Dim myDataSet As New DataSet()
myDataSet.ReadX ml(Server.MapPa th("blog.xml") )
Dim view As DataView = New DataView(myData Set.Tables(0))
view.AllowDelet e = False
view.AllowEdit = False
view.AllowNew = False
view.Sort = "name ASC"
Return view
End Function
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim view as DataView = MakeDataView()
dgBooksPretty.D ataSource = view
dgBooksPretty.A llowSorting = True
dgBooksPretty.D ataBind()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Our Blog</title>
</head>
<body borderwidth="20 px" background="vig nette.gif">
<div align="left"
style="border-style: inset; border-color: white;
overflow: auto; font-size: medium; width: 84%;
font-family: 'Times New Roman'; height: 599px;
color: black; left: 79px; position: absolute;
top: 11%; background-color: #ccffff; padding-right:
10px; float: none; margin-left: 20px;
clip: rect(auto auto auto auto); text-indent: 5%;
text-align: left; padding-left: 10px;">
<div style="text-indent: 20px">
<asp:datagrid id="dgBooks"
runat="server"
Visible="False"
Height="1px"
Width="1px" />
<asp:datagrid id="dgBooksPret ty"
runat="server"
AutoGenerateCol umns="False"
Font-Name="Verdana"
Font-Size="Small"
HorizontalAlign ="Center"
ItemStyle-BackColor="#C0F FC0"
AlternatingItem Style-BackColor="Whit e"
Width="911px"
Height="128px"
AllowSorting="T rue"
BorderColor="Pe achPuff"
BorderStyle="Ou tset"
BorderWidth="10 px" CellSpacing="2" >
<HeaderStyle BackColor="Dark Green"
HorizontalAlign ="Center"
ForeColor="Whit e"
Font-Bold="True" />
<Columns>
<asp:BoundColum n HeaderText="Blo g Entry" DataField="entr y" />
<asp:BoundColum n HeaderText="Nam e" DataField="name " />
</Columns>
<AlternatingIte mStyle BackColor="Whit e" />
<ItemStyle BackColor="#C0F FC0" />
</asp:datagrid>
<p align="center">
</p>
</body>
</html>
Jun 27 '08 #1
1 1076
On May 30, 8:13 am, slinky <campbellbrian2 ...@yahoo.comwr ote:
Thanks for any help folks:

I have two .aspx pages that are workling well: one is for entering
entries in a blog and another for viewing those entries. What I want
to do is combine the two into one so I have a textbox and submit
button at the top and the blog entries below. Any ideas?

Here is my entry page:

<%@ import Namespace="Syst em.Data" %>
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Using ds As New DataSet()
ds.ReadXml(Serv er.MapPath("blo g.xml"))
txtNewEvent.Dat aBind()
txtDate.DataBin d()
End Using
End If
End Sub
Private Sub btnSubmit_Click (ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles btnSubmit.Click
Using ds As New DataSet()
ds.ReadXml(Serv er.MapPath("blo g.xml"))
Dim dr As DataRow = ds.Tables(0).Ne wRow()
dr("entry") = txtNewEvent.Tex t
dr("name") = txtDate.Text
ds.Tables(0).Ro ws.Add(dr)
ds.WriteXml(Ser ver.MapPath("bl og.xml"))
Response.Redire ct("http://site.com/Default.aspx")
End Using
End Sub

Protected Sub Button1_Click(B yVal sender As Object, ByVal e As
System.EventArg s)
Response.Redire ct("http://site.com/Default.aspx")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Blog Entry</title>
<style type="text/css">
#Form1
{
height: 508px;
width: 727px;
}
</style>
</head>

<body background="vig nette.gif" runat="server">
<a href="javascrip t:my_win()"></a<form id="Form1" method="post"
runat="server">

<b>
<a href="/demos/books.xml"></a>
<asp:Label ID="Label2" runat="server" BackColor="#00C 0C0" Font-
Bold="True" Font-Size="Large"
Text="Enter your comments into our blog:" Width="375px"
BorderStyle="Ou tset"></asp:Label>
<asp:TextBox ID="txtNewEvent " runat="server" Width="451px"
Height="212px"
style="padding-right: 5%; padding-left: 5%; padding-bottom:
5%; margin: 5%; padding-top: 5%"
TextMode="Multi Line"></asp:TextBox>

<asp:Button ID="btnSubmit" runat="server" Text="Submit"
OnClick="btnSub mit_Click" /></b><br />
<asp:Label ID="Label1" runat="server" BackColor="#00C 0C0"
Font-Bold="True" Text="Your Name" BorderStyle="Ou tset"></asp:Label>
<asp:TextBox ID="txtDate" runat="server" Width="266px"></
asp:TextBox>

<p>
<b>
<asp:Button ID="Button1" runat="server" BackColor="Aqua "
Style="z-index: 107; left: 750px;
position: absolute; top: 488px; font-weight: 700; width:
168px;"
Text="Home" onclick="Button 1_Click" />
</b></p>
<p>

</p>
</form>
</body>
</html>

Here is my viewing page:

<%@ import Namespace="Syst em.Data" %>
<script runat="server">
Private Function MakeDataView() as DataView
Dim myDataSet As New DataSet()
myDataSet.ReadX ml(Server.MapPa th("blog.xml") )
Dim view As DataView = New DataView(myData Set.Tables(0))
view.AllowDelet e = False
view.AllowEdit = False
view.AllowNew = False
view.Sort = "name ASC"
Return view
End Function

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim view as DataView = MakeDataView()
dgBooksPretty.D ataSource = view
dgBooksPretty.A llowSorting = True
dgBooksPretty.D ataBind()
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >

<head id="Head1" runat="server">
<title>Our Blog</title>
</head>
<body borderwidth="20 px" background="vig nette.gif">
<div align="left"
style="border-style: inset; border-color: white;
overflow: auto; font-size: medium; width: 84%;
font-family: 'Times New Roman'; height: 599px;
color: black; left: 79px; position: absolute;
top: 11%; background-color: #ccffff; padding-right:
10px; float: none; margin-left: 20px;
clip: rect(auto auto auto auto); text-indent: 5%;
text-align: left; padding-left: 10px;">
<div style="text-indent: 20px">
<asp:datagrid id="dgBooks"
runat="server"
Visible="False"
Height="1px"
Width="1px" />
<asp:datagrid id="dgBooksPret ty"
runat="server"
AutoGenerateCol umns="False"
Font-Name="Verdana"
Font-Size="Small"

HorizontalAlign ="Center"
ItemStyle-BackColor="#C0F FC0"
AlternatingItem Style-BackColor="Whit e"
Width="911px"
Height="128px"
AllowSorting="T rue"
BorderColor="Pe achPuff"
BorderStyle="Ou tset"
BorderWidth="10 px" CellSpacing="2" >
<HeaderStyle BackColor="Dark Green"
HorizontalAlign ="Center"
ForeColor="Whit e"
Font-Bold="True" />
<Columns>
<asp:BoundColum n HeaderText="Blo g Entry" DataField="entr y" />
<asp:BoundColum n HeaderText="Nam e" DataField="name " />
</Columns>
<AlternatingIte mStyle BackColor="Whit e" />
<ItemStyle BackColor="#C0F FC0" />
</asp:datagrid>
<p align="center">
</p>
</body>
</html>
I didn't read your code, but I have a suggestion none the less.

What you might try is to convert your Pages into ASP.NET UserControls
and add them to a single page, one positioned on top of the other one.

Thanks,

Seth Rowe [MVP]
Jun 27 '08 #2

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

Similar topics

36
4099
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just yet though, tables are a lot easier." That's because we have a lot of developers who aren't ready to move to CSS-P and DIVs just yet. But I'm being told our policies were contradictory. If we're going to
4
2705
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here: http://www.wpdfd.com/editorial/wpd0103.htm#toptip (the second example) The problem is, under the image is a large table. But using the above positioning, now the table starts at the top of the page and runs underneath the image.
2
2156
by: Tim Charles | last post by:
Hello I am close to finishing my first properly css-friendly site (at least I hope it is), and am looking for some general feedback, plus a specific question answered, if possible. http://www.ediecast.co.uk/ is the url. The specific question is whether anyone can give me any help getting the footer to actually go at the bottom of the page, rather than staying in the
11
2629
by: NS | last post by:
I am relativly new to css positioning and have a question regarding the display of a DHTML pop-up Here is the basic HTML I am using: <html> <head> <script language="JavaScript"> <!--
17
14364
by: pasdecrap | last post by:
The following code will produce similar results in IE6 and firefox 1.0.4 however the left margin in FF is 4 pixels and in IE it is 5. Can anyone see why this is happening? I can't seem to figure it out! TIA Jeff <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
1
1531
by: John Leeke | last post by:
How are images positioned on a page? In particular, how do I adapt the following javascript code: ********** <img src="officecam0000.jpg" name="myImageName"> <script language="JavaScript"> function reloadImage() { var now = new Date(); if (document.images) {
7
2397
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any distortion when the page was rendered. Life was good. now in 2.0 I'm using the default placeholder and putting a table in the placeholder and putting controls in the cells in the table. "the way it is supposed to be done" I have a textbox in a table that is defined as follows... <td...
5
1875
by: aljamala | last post by:
Hi, I have a group of 5 tables laid out of the web page. 2 go on the left side and 3 on the right. These tables retrieve data from the database so the number of records (rows) returned varies. So the problem I am having at the moment is that if the table gets longer by one or two rows, all my alignment goes of out whack for the other tables. Is there a way for example to place table #2 right after table#1 ends?
5
2402
by: Howard | last post by:
I have seen a lot of examples of 2 & 3 Collumn layout schemes. But I have not yet found any examples for positioning images and centering them by the browser. I notice that there are CSS properties for Left and Right, but not for Centering. So my question is How does one center an image to the Browser window? I was thinking about converting a page for my friends catering. It's a table center in the
0
8380
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
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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
8497
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
8598
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...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.