473,786 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\wwwr oot Directory.

When I type on my Internet explorer: http:\\localhos t\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_It emInserted(ByVa l sender As Object, ByVal e
As System.Web.UI.W ebControls.Deta ilsViewInserted EventArgs)

If (Not e.Exception Is Nothing) Then

ErrorMessageLab el.Text = "An error occured while entering this
record. Please verify you have entered data in the correct format."
e.ExceptionHand led = True
End If
GridView1.DataB ind()
End Sub

Protected Sub DetailsView1_It emUpdated(ByVal sender As Object, ByVal e
As System.Web.UI.W ebControls.Deta ilsViewUpdatedE ventArgs)

GridView1.DataB ind()
End Sub

Protected Sub DropDownList1_S electedIndexCha nged(ByVal sender As Object,
ByVal e As EventArgs)

DetailsView1.Ch angeMode(Detail sViewMode.ReadO nly)
End Sub

Protected Sub GridView1_Selec tedIndexChanged (ByVal sender As Object,
ByVal e As EventArgs)

DetailsView1.Ch angeMode(Detail sViewMode.ReadO nly)
End Sub

Protected Sub GridView1_PageI ndexChanged(ByV al sender As Object, ByVal e
As EventArgs)

DetailsView1.Ch angeMode(Detail sViewMode.ReadO nly)
End Sub

Protected Sub GridView1_Sorte d(ByVal sender As Object, ByVal e As
System.EventArg s)
DetailsView1.Ch angeMode(Detail sViewMode.ReadO nly)
End Sub

Protected Sub GridView1_RowDe leted(ByVal sender As Object, ByVal e As
GridViewDeleted EventArgs)

If (Not e.Exception Is Nothing) Then

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

Protected Sub DetailsView1_Da taBound(ByVal sender As Object, ByVal e As
EventArgs)

If (DetailsView1.C urrentMode = DetailsViewMode .Insert) Then

Dim stateTextBox As TextBox =
CType(DetailsVi ew1.Rows(6).Cel ls(1).Controls( 0), TextBox)
stateTextBox.Te xt = DropDownList1.S electedValue
stateTextBox.En abled = False
End If
End Sub

</script>
<html>
<head id="Head1" runat="server">
<title>GridVi ew DetailsView Master-Details (Insert)</title>
</head>
<body>
<form id="form1" runat="server">
<b>Choose a state:</b>
<asp:DropDownLi st ID="DropDownLis t1" DataSourceID="S qlDataSource2"
AutoPostBack="t rue"
DataTextField=" state" runat="server"
OnSelectedIndex Changed="DropDo wnList1_Selecte dIndexChanged" />
<asp:SqlDataSou rce ID="SqlDataSour ce2" runat="server"
SelectCommand=" SELECT DISTINCT [state] FROM [authors]"
ConnectionStrin g="<%$ ConnectionStrin gs:Pubs %>" />
<br />
<br />
<table>
<tr>
<td valign="top">
<asp:GridView ID="GridView1" AllowSorting="T rue"
AllowPaging="Tr ue" runat="server"
DataSourceID="S qlDataSource1" DataKeyNames="a u_id"
AutoGenerateCol umns="False" Width="500px" SelectedIndex=" 0"
OnSelectedIndex Changed="GridVi ew1_SelectedInd exChanged"
OnPageIndexChan ged="GridView1_ PageIndexChange d"
OnRowDeleted="G ridView1_RowDel eted" OnSorted="GridV iew1_Sorted">
<Columns>
<asp:CommandFie ld ShowSelectButto n="true"
ShowDeleteButto n="true" />
<asp:BoundFie ld DataField="au_i d" HeaderText="au_ id"
ReadOnly="True" SortExpression= "au_id" />
<asp:BoundFie ld DataField="au_l name" HeaderText="au_ lname"
SortExpression= "au_lname" />
<asp:BoundFie ld DataField="au_f name" HeaderText="au_ fname"
SortExpression= "au_fname" />
<asp:BoundFie ld DataField="stat e" HeaderText="sta te"
SortExpression= "state" />
</Columns>
</asp:GridView>
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:Pubs %>"
SelectCommand=" SELECT [au_id], [au_lname], [au_fname], [state]
FROM [authors] WHERE ([state] = @state)"
DeleteCommand=" DELETE FROM [authors] WHERE [au_id] = @au_id">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Drop DownList1" Name="state"
PropertyName="S electedValue"
Type="String" />
</SelectParameter s>
</asp:SqlDataSour ce>
</td>
<td valign="top">
<asp:DetailsVie w AutoGenerateRow s="False" DataKeyNames="a u_id"
DataSourceID="S qlDataSource3"
HeaderText="Aut hor Details" ID="DetailsView 1" runat="server"
Width="275px" OnItemUpdated=" DetailsView1_It emUpdated"
OnItemInserted= "DetailsView1_I temInserted"
OnDataBound="De tailsView1_Data Bound">
<Fields>
<asp:BoundFie ld DataField="au_i d" HeaderText="au_ id"
ReadOnly="True" SortExpression= "au_id" />
<asp:BoundFie ld DataField="au_l name" HeaderText="au_ lname"
SortExpression= "au_lname" />
<asp:BoundFie ld DataField="au_f name" HeaderText="au_ fname"
SortExpression= "au_fname" />
<asp:BoundFie ld DataField="phon e" HeaderText="pho ne"
SortExpression= "phone" />
<asp:BoundFie ld DataField="addr ess" HeaderText="add ress"
SortExpression= "address" />
<asp:BoundFie ld DataField="city " HeaderText="cit y"
SortExpression= "city" />
<asp:BoundFie ld DataField="stat e" HeaderText="sta te"
SortExpression= "state" />
<asp:BoundFie ld DataField="zip" HeaderText="zip "
SortExpression= "zip" />
<asp:CheckBoxFi eld DataField="cont ract" HeaderText="con tract"
SortExpression= "contract" />
<asp:CommandFie ld ShowEditButton= "True"
ShowInsertButto n="True" />
</Fields>
</asp:DetailsView >
<asp:SqlDataSou rce ID="SqlDataSour ce3" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs: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)">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Grid View1" Name="au_id"
PropertyName="S electedValue"
Type="String" />
</SelectParameter s>
<UpdateParamete rs>
<asp:Paramete r Name="au_lname" Type="String" />
<asp:Paramete r Name="au_fname" Type="String" />
<asp:Paramete r Name="phone" Type="String" />
<asp:Paramete r Name="address" Type="String" />
<asp:Paramete r Name="city" Type="String" />
<asp:Paramete r Name="state" Type="String" />
<asp:Paramete r Name="zip" Type="String" />
<asp:Paramete r Name="contract" Type="Boolean" />
<asp:Paramete r Name="au_id" Type="String" />
</UpdateParameter s>
<InsertParamete rs>
<asp:Paramete r Name="au_id" Type="String" />
<asp:Paramete r Name="au_lname" Type="String" />
<asp:Paramete r Name="au_fname" Type="String" />
<asp:Paramete r Name="phone" Type="String" />
<asp:Paramete r Name="address" Type="String" />
<asp:Paramete r Name="city" Type="String" />
<asp:Paramete r Name="state" Type="String" />
<asp:Paramete r Name="zip" Type="String" />
<asp:Paramete r Name="contract" Type="Boolean" />
</InsertParameter s>
</asp:SqlDataSour ce>
</td>
</tr>
</table>
<br />
<asp:Label ID="ErrorMessag eLabel" EnableViewState ="false" runat="server"
/>
</form>
</body>
</html>
Jan 25 '06 #1
0 1926

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

Similar topics

2
9040
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 access HTM file, it shows up fine on IE 6. But, when we access any ASP file, it gets an "error 500 the Page cannot be displayed". This happens even when the ASP page is as simple as response.write "testing" How can I fix this problem? THanks.
10
10824
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 the browser, followed by a descriptive error message: Microsoft VBScript runtime error '800a000b' Division by zero followed by the number of the error-making line
2
3240
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 ------------ The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed.
6
1465
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 data that I write via response.write before the error occurs. The error is happening in a loop, on the third line below: RESPONSE.WRITE("x=" & x & ", " & aFieldsData(UpdateRecNum,x) & "<BR>") tFLD = trim(aFieldsData(UpdateRecNum,x)) tFLD =...
7
4537
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" ACTION="UploadAction.asp" METHOD="POST" enctype=multipart/form-data> <input type="file" name="fileName"> //etc ... </FORM>
1
1726
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, even though the file exists! For example, the error occurs when trying to access this page and several others. http://86.34.27.221/MyWeb/Default.aspx Interestingly, when I try this page it shows up fine:
1
2285
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 from the textbox. When I open the page in IE (whatever version) i get : ############################################################ The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then
25
17218
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 being uploaded. I'm also using the HtmlInputFile control to do the uploading. My problem is that when the user's file size exceeds 512k, the page immediately redirects to the "The page cannot be displayed" error page which is very confusing. ...
0
23511
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) 5: Procedure call or argument is not valid. 6: Overflow. 7: Out of memory.
6
3127
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
9496
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
10363
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
10164
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
10110
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
9961
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
8989
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...
0
5397
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
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.