473,410 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Error: The XML page cannot be displayed

I have copied the following code from Internet, and copied it to a file
named : test.aspx, and copied that file to c:\Inetpub\wwwroot Directory.

When I type on my Internet explorer: http:\\localhost\test.aspx, following
error occured:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.
--------------------------------------------------------------------------------

A name was started with an invalid character. Error processing resource
'http://localhost/test.aspx'. Line 1, Position 2

<%@ Page Language="VB" %>
Any Idea what am I missing ?Best Regards,Luqman
<%@ Page Language="VB" %>
<script runat="server">

Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DetailsViewInsertedEvent Args)

If (Not e.Exception Is Nothing) Then

ErrorMessageLabel.Text = "An error occured while entering this
record. Please verify you have entered data in the correct format."
e.ExceptionHandled = True
End If
GridView1.DataBind()
End Sub

Protected Sub DetailsView1_ItemUpdated(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DetailsViewUpdatedEventA rgs)

GridView1.DataBind()
End Sub

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As EventArgs)

DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As EventArgs)

DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub

Protected Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e
As EventArgs)

DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub

Protected Sub GridView1_Sorted(ByVal sender As Object, ByVal e As
System.EventArgs)
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub

Protected Sub GridView1_RowDeleted(ByVal sender As Object, ByVal e As
GridViewDeletedEventArgs)

If (Not e.Exception Is Nothing) Then

ErrorMessageLabel.Text = "Failed to DELETE due to foreign key
contstraint on the table. You may only delete rows which have no related
records."
e.ExceptionHandled = True
End If
End Sub

Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
EventArgs)

If (DetailsView1.CurrentMode = DetailsViewMode.Insert) Then

Dim stateTextBox As TextBox =
CType(DetailsView1.Rows(6).Cells(1).Controls(0), TextBox)
stateTextBox.Text = DropDownList1.SelectedValue
stateTextBox.Enabled = False
End If
End Sub

</script>
<html>
<head id="Head1" runat="server">
<title>GridView DetailsView Master-Details (Insert)</title>
</head>
<body>
<form id="form1" runat="server">
<b>Choose a state:</b>
<asp:DropDownList ID="DropDownList1" DataSourceID="SqlDataSource2"
AutoPostBack="true"
DataTextField="state" runat="server"
OnSelectedIndexChanged="DropDownList1_SelectedInde xChanged" />
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
SelectCommand="SELECT DISTINCT [state] FROM [authors]"
ConnectionString="<%$ ConnectionStrings:Pubs %>" />
<br />
<br />
<table>
<tr>
<td valign="top">
<asp:GridView ID="GridView1" AllowSorting="True"
AllowPaging="True" runat="server"
DataSourceID="SqlDataSource1" DataKeyNames="au_id"
AutoGenerateColumns="False" Width="500px" SelectedIndex="0"
OnSelectedIndexChanged="GridView1_SelectedIndexCha nged"
OnPageIndexChanged="GridView1_PageIndexChanged"
OnRowDeleted="GridView1_RowDeleted" OnSorted="GridView1_Sorted">
<Columns>
<asp:CommandField ShowSelectButton="true"
ShowDeleteButton="true" />
<asp:BoundField DataField="au_id" HeaderText="au_id"
ReadOnly="True" SortExpression="au_id" />
<asp:BoundField DataField="au_lname" HeaderText="au_lname"
SortExpression="au_lname" />
<asp:BoundField DataField="au_fname" HeaderText="au_fname"
SortExpression="au_fname" />
<asp:BoundField DataField="state" HeaderText="state"
SortExpression="state" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Pubs %>"
SelectCommand="SELECT [au_id], [au_lname], [au_fname], [state]
FROM [authors] WHERE ([state] = @state)"
DeleteCommand="DELETE FROM [authors] WHERE [au_id] = @au_id">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="state"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
<td valign="top">
<asp:DetailsView AutoGenerateRows="False" DataKeyNames="au_id"
DataSourceID="SqlDataSource3"
HeaderText="Author Details" ID="DetailsView1" runat="server"
Width="275px" OnItemUpdated="DetailsView1_ItemUpdated"
OnItemInserted="DetailsView1_ItemInserted"
OnDataBound="DetailsView1_DataBound">
<Fields>
<asp:BoundField DataField="au_id" HeaderText="au_id"
ReadOnly="True" SortExpression="au_id" />
<asp:BoundField DataField="au_lname" HeaderText="au_lname"
SortExpression="au_lname" />
<asp:BoundField DataField="au_fname" HeaderText="au_fname"
SortExpression="au_fname" />
<asp:BoundField DataField="phone" HeaderText="phone"
SortExpression="phone" />
<asp:BoundField DataField="address" HeaderText="address"
SortExpression="address" />
<asp:BoundField DataField="city" HeaderText="city"
SortExpression="city" />
<asp:BoundField DataField="state" HeaderText="state"
SortExpression="state" />
<asp:BoundField DataField="zip" HeaderText="zip"
SortExpression="zip" />
<asp:CheckBoxField DataField="contract" HeaderText="contract"
SortExpression="contract" />
<asp:CommandField ShowEditButton="True"
ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:Pubs %>"
SelectCommand="SELECT [au_id], [au_lname], [au_fname], [phone],
[address], [city], [state], [zip], [contract] FROM [authors] WHERE ([au_id]
= @au_id)"
UpdateCommand="UPDATE [authors] SET [au_lname] = @au_lname,
[au_fname] = @au_fname, [phone] = @phone, [address] = @address, [city] =
@city, [state] = @state, [zip] = @zip, [contract] = @contract WHERE [au_id]
= @au_id"
InsertCommand="INSERT INTO [authors] ([au_id], [au_lname],
[au_fname], [phone], [address], [city], [state], [zip], [contract]) VALUES
(@au_id, @au_lname, @au_fname, @phone, @address, @city, @state, @zip,
@contract)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="au_id"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="au_lname" Type="String" />
<asp:Parameter Name="au_fname" Type="String" />
<asp:Parameter Name="phone" Type="String" />
<asp:Parameter Name="address" Type="String" />
<asp:Parameter Name="city" Type="String" />
<asp:Parameter Name="state" Type="String" />
<asp:Parameter Name="zip" Type="String" />
<asp:Parameter Name="contract" Type="Boolean" />
<asp:Parameter Name="au_id" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="au_id" Type="String" />
<asp:Parameter Name="au_lname" Type="String" />
<asp:Parameter Name="au_fname" Type="String" />
<asp:Parameter Name="phone" Type="String" />
<asp:Parameter Name="address" Type="String" />
<asp:Parameter Name="city" Type="String" />
<asp:Parameter Name="state" Type="String" />
<asp:Parameter Name="zip" Type="String" />
<asp:Parameter Name="contract" Type="Boolean" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
<br />
<asp:Label ID="ErrorMessageLabel" EnableViewState="false" runat="server"
/>
</form>
</body>
</html>
Jan 25 '06 #1
0 1917

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

Similar topics

2
by: Fie Fie Niles | last post by:
At our client site, they are using IIS 5.0. We created a virtual directory that points to a directory on the IIS server, and gave the execute permissions as "Scripts and Executables". When we...
10
by: | last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by...
2
by: Anton van der Merwe | last post by:
I'm getting the foolowing error when trying to view an asp page on a windows2003 server. On our previous IIS server (Windows 2000) the error was described in detail. Windows 2003 ------------...
6
by: Colin Colin | last post by:
I have an ASP program that is getting an error. When I get the error I get Page Cannot Be Displayed along with the line that causes the error and what the error is. What I am not getting is any...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
1
by: VB Programmer | last post by:
I am setting up a intranet webserver that will run my ASP.NET website. (Everything works fine locally.) When I try accessing an aspx page, via IE, it gives me the "Page cannot be displayed" error,...
1
by: ericvdb | last post by:
Hi all, I'm trying to fill a PDF form with asp.net using the FDF Toolkit. I have a simple form with a textbox and a button. When the button is clicked, the pdf should open with the field filled...
25
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
6
by: TC | last post by:
Hey All, I'm receiving a weird error in IE now: "The XML page cannot be displayed" This is even with the simplest of pages that I previously could view. Any ideas?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...
0
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...
0
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...

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.