.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

XML not getting shown completely when when i try to generate it and show it on a browser

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net


I have created a code to generate XML using XmlTextWriter class. But after the XML loads on page. I get this message after few xml tags.

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.

Only one top level element is allowed in an XML document. Error processing resource 'http://localhost:4195/GenerateXML.aspx...


When i see the XML from View Source its fine . All the tags are well formed but the problem is its not showing up on Internet explorer.

Please help


View Complete Post

More Related Resource Links

Show form in browser?

Hi all. I am working on MOSS 2007 Enterprise platform. I am using InfoPath, and have checked on "Design a form template that can be opened in a browser or InfoPath", and also edited the settings of my Document Library to display browser enabled documents as "Display as a Web page".  The template is saved as a content type. When I go to my library, I can chose to create a new document with my InfoPath template, and it will open in a web site. I don't want it to behave like this. I want my form to be shown on a page, within the masterpage, where the users can register information and submit by clicking on a button. Can this be done? Are there any web parts to accomplish this? Regards

how to show popup when we close the browser

i want the wen i close the browser a popup should come confirm r u sure u 
want 2 exit if yes the browser should close and current date should be saved into the database.
i have tryied a code as
protected void Page_UnLoad(object sender, EventArgs e)

DateTime d = System.DateTime.Now;
string cn = "Data Source=hcl;Initial Catalog=mydata;Integrated Security=True";
SqlConnection con = new SqlConnection(cn);
SqlCommand cmd = new SqlCommand("insert into mydate values(@d)", con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add(new SqlParameter("@d", d));
// cmd.Parameters.Add(new SqlParameter("@b", b));


but it was not succesful also before i close the browser the data is saved in the database.also i dont know how to call alert function 
as r u sure u want to exit .plz help

memory usage (consumption) of individual controls on a web form shown in a browser



Is there a way to check the memory usage (consumption) of individual controls on a web form shown in a browser. Like Repeater Control, Multiline Text box etc. The reason is I am putting the repeater control in session and checking the status of controls, based on which I am doing further actions.



Could not generate the workflow visualization. A browser visualization will not be displayed with t


Hello, i would like to use Workflow Visualization at SharePoint 2010 Enterprise. I have enalbed Visio services, installed SP Designer 2010, Visio Premium 2010 and Silverlight.

I have checked all of thise:

- On the Manage Services on Server page in the Central Admin Site, verify that “Visio Graphics Services” is started.
- On the Manage Web Applications in the Central Admin Site, verify that Visio Graphics Service is available as the Service Connections for the given web application hosting the site where workflow visualizations needs to be enabled.
- On the Manage Farms feature page in the Central Admin Site, “Visio Web Access” feature is activated
- On the Manage Site Collections Feature page hosting the site for the workflow visualizations “SharePoint Server Enterprise Site Collection features” feature is activated.
- On the Manage Site Features page hosting the workflow visualizations, verify that “SharePoint Server Enterprise Site features” feature is activated.
- Verify that Silverlight 3 or later is installed on the client browser.
- From the workflow settings page in the SharePoint Designer, verify that “Show Workflow visualizations on Status Page” checkbox is selected.

But when i trying to publish WF i'm gettin error:

Microsoft Share

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Generate thumbnails on the fly

There are many posts how to generate thumbnails using ASP.NET. Some good some less. Be sure to get distance from the versions that use Image.GetThumbnailImage method.

Generate Random Numbers

SQL Server has a built-in function that generates a random number, the RAND() mathematical function. The RAND math function returns a random float value from 0 through 1.

How to setup a Mobile Browser Emulator in Windows Mobile 6:

In the following tutorial, I cover the process of Setting up Windows Mobile 6 for Mobile Browser Emulation using the Microsoft Device Emulator. This enables a user to experience Windows Mobile 6 on a PC via Emulation without even owning a Windows Mobile 6 product. It can be a great way to test drive Windows Mobile 6 before purchasing a product with it installed. In our case, it allowed us to Emulate Windows Mobile Browsing so that we could optimize our sites for the Mobile viewing audience. Installation and Emulation is simple and fairly straight forward.

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

*.axd script references not being rendered to browser


I'm running VS2010 with .net 4.0, and am running into issues with the .net ajax script tags mysteriously not being rendered to the browser.

So far I've reduced it to a scenario where I set the DataSourceID property of a databound control.  More specifically, I've only tested it on a Gridview and a DropDownList.

This can be reproduced fairly easily on my machine by following these steps:

1. Create a new empty Web Application Project

2. Create a new Web Form

3. Add a ScriptManager inside the form

4. Add a DropDownList and a DataSource (I used an ObjectDataSource)

5. Set the DataSourceID property of the DropDownList to the ID of the DataSource.  This can be done either declaratively on the .aspx page, or in the code behind in the aspx.cs page, and both produce the same results.

6. Open the page in a browser and watch as you get a javascript error stating "Sys is not defined" and notice that the page source contains no script tags referencing *.axd scripts.

Here's my source code showing my set up:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ScriptResourceFAIL.Default" %>


datalist image slide show problem


hi friends

i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />

I above code works perfectly and the slide show e

WebDev.WebServer.exe has encounted a problem and needs to close when trying to view page in browser


Hi, whenever I load an aspx page in vwde2008, I get the message in the subject of this post.  After I click Ok on that, I get a dialog box, Unable to Connect to the ASP.Net development center.  What can I do to troubleshoot?

I am using Windows XP SP3, vwde2008 with SP1, on a HP desktop.  Also using Office 2003 if that is relevant at all.

Thanks, Justin

create user wizard login error message dont show in a message box?




i am using create user wizard and capturing other information within content template when a new user

registers. Some of the textboxes are binded to required field validators.


there is a validation control on the page and ShowMessage box is True.

If they dont complete some of the text boxes then the message box pops Up with the error message.

It does not however include information errors like "User already exists" or Email address already exists

from the create user wizard membership  UserName and Password Textboxes


is it possilbe to hook all of these up so I get one message box with all errors including membership ones?




browser gives jibberish when State manager (sql) is turned on


Hi all, we're testing our web app with a state manager so that we can do distributed rollouts. We're not getting any errors, but we are getting jibberish returned for every page request. 

(it won't even let me paste it in here)

HOw do I get it to serve the pages normally?


Can't get an Icon to show for Desktop shortcut and Program Menu



I've created a SetupWizard, but can't get it to show the Icon for the shortcut on desktop and program menu. The installation goes fine without any errors, the only problem is the icon.

I've made a shortcut of my exe file in the Application Folder and dragged the shortcut to the Desktop folder, then on the shortcut properties, I assigned it an icon picture located in Application Folder.

Any suggestions will be very much appreciated.


Why show only one record?



// Update these variables to values whatever you are storing in your table
        // If you are storing as CARD NUMBER, update this Card Number Attribute Name to CARD NUMBER
        string strCardNumberAttributeName = "Credit card number";
       // string strCardTypeAttributeName = "1";
        string strExpiryDateAttributeName = "Expiry date";
        DataTable dtPaymentDetails = new DataTable();

        string queryString = "SELECT tbl_Payments.PaymentId, tbl_PaymentDetails.AttributeName, tbl_PaymentDetails.Value, tbl_Payments.PaymentType FROM tbl_Payments INNER JOIN tbl_PaymentDetails ON tbl_Payments.ID = tbl_PaymentDetails.PaymentId WHERE ATTRIBUTENAME IN ('" + strCardNumberAttributeName +
                                   "','" + strExpiryDateAttributeName + "') ORDER BY PaymentId";

        string connectionString = "data source=.\\SQLEXPRESS;Integrated Security=SSPI;" +
                                           "AttachDBFilename=|DataDirectory|\\BurnbetDatabase.mdf;User Instance=true";
        using (SqlConnection connection = new SqlConnection(connectionString))
            SqlCommand command = new SqlCommand(queryString, connection);
            SqlDataReader reader = command.ExecuteR

displaying xsl results in browser


Hi guys,

How can I test what my xsl spits out in the browser, rather than just viewing the xsl itself?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend