473,804 Members | 3,894 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combining funtionality from two pages

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 1022
Hi,

Convert both of your aspx page to a ascx user control and drop both of
them in a aspx page

follow this thread to get a step by step guide for converting
aspx(page) to ascx(usercontro l)

http://www.dotnetspider.com/forum/Vi...px?ForumId=121

Thanks

Munna

www.munna.shatkotha.com
Jun 27 '08 #2

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

Similar topics

2
2748
by: Brian | last post by:
Hi All, Can someone please point me in the right direction I am having problems combining JS and ASP. What I am trying to do is store in a database using ASP the referring page of my visitors. I got the ASP working great and when I use the document.referrer in an alert it works too, but when I try to combine the 2 languages that is when I get an error that I cannot fix. Here is the code fragment that is not working: rs("ReferPage")...
2
3277
by: Chris Mullins | last post by:
I've spent a bit of time over the last year trying to implement RFC 3454 (Preparation of Internationalized Strings, aka 'StringPrep'). This RFC is also a dependency for RFC 3491 (Internationalized Domain Names / IDNA) which is something that I also need to support. The problem that I've been struggling with in .NET is that of Unicode Code Points > 0xFFFF. These points are encoded into UTF8 using the Surrogate Pair encoding scheme that...
3
1735
by: alwayswinter | last post by:
I currently have a form where a user can enter results from a genetic test. I also have a pool of summaries that would correspond to different results that a user would enter into the form. I ideally I would like to have the user enter their results and then have a master summary created with the different word or HTML files on submit. (condition 1 + condition 2 = combining/displaying corresponding HTML files) I've gotten as far as...
7
4821
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following capital letters all work correctly - B C D F G M S T with the diacritical marker &#_0775. Why am I having a problem with P?
22
698
by: Martin C | last post by:
I have inherited a database which has a table for each of our 1200 customers. Each table is exactly the same. It is very difficult to generate reports I would like to create a new table and take in all the records of all the tables into this database. The new table will have an extra field which will hold the table name for the records imported from the tables. Can anyone help?
5
2447
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the web part page? Does it take place at the page level? ...or the content area level? 3. Where is the Web Part Manager instantiated? ...in the Master Page? ....Content Page? ...elsewhere?
1
1654
by: Bond | last post by:
Hi friend I just wanna know how to Combine Fash pages or dreamviwer pages with ASP.Net or VB.Net Page and how to use the AD Rotator Component in ASP.Net thanking you
5
5644
by: Tristan Miller | last post by:
Greetings. Is it possible using HTML and CSS to represent a combining diacritical mark in a different style from the letter it modifies? For example, say I want to render Å‘ (Latin small letter o with a double acute accent), but with the o in black and the double acute accent in green. Are either of the following valid? 1. <span style="color: black;">o</span><span style="color: green;">&#x030B;</span>
1
1112
by: Andy B | last post by:
I have 2 web applications: Main and InHim. I currently have 2 domain names pointing to these applications. www.eternityrecords.org/ points to Main and www.inhim.eternityrecords.org points to InHim. The InHim application is sort of senseless because it only has 2 pages in it. I want to merge these 2 applications but still keep the www.inhim.eternityrecords.org domain name pointing to the pages that were in the InHim application. How do I do...
0
9710
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
9589
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
10593
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...
1
10329
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
5527
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...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
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
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
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.