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

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

Render XML text *inside* of an ASP.net page?

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net

I have a block of XML text I need to show the user (so they can copy/paste the XML from the screen)

I use StringWriter() to make the XML a String but when I use Response.Write(xmlString) I get the following error

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '<?xml version="1.0" '.

I guess IE does not like rendering XML in the middle of a page?

is there anyway to show the XML data in the middle of my ASPX page?

Many thanks! :)

View Complete Post

More Related Resource Links

reference from menubuttons to text parts in article on the same page


Hi, I'm searching now for hours but couldn't find it.Cry

In my menu i have several buttons which (by a <a href..) should go the a part of an article that is in the same form.

Menu button : What is a database should go to the page default.aspx and in there is an article published.
A part of this article is having a piece of text about "what is a database"

Menu button: how to make a query should go to this same article in the same page but then to the part that is have the piece about the query. The next could be an example of what i'm doing:

    <li><a href="default.aspx ?????>what is a database</a></li>
    <li><a href="default.aspx ?????>what is a query</a></li>

Where my question marks are, there should be a connection to that particular piece of text.
In each article part there is an ID="text1" and the second part id="text2"

How shoudl i do that, Should i use a question mark.
Please give me some guidance how to structure the <li> statement or a pointer where I can read about it.


Foundations: Render Text On A Path With WPF


With Windows Presentation Foundation (WPF) you can lay out text on a path, then animate the individual points defining the path and watch the characters bounce around in response.

Charles Petzold

MSDN Magazine December 2008

allow client to modify text on web page


I have been trying to find out how I can allow a user to modify/update a page/pages on a web site. I understand there has to be site security with authentication and authorisation but what is there as a user interface for them easily to update a page? 

Thanks for any pointers.

Why does text and page formating changes randomly?

Hallo there, First of all I don't know if I am posting in the right forum, so let me know if there is another forum for this issue. My form text and entire page formating changes once a while and I don't know why. e.g. font color, background color of certain paragraphs or table look changes, it seems randomly, I think it has something to do with the style but I don't know how to avoid this repeated text formating loses. In details: U am using Visual Studio 2010 Professional and is set for Visual Web Development. I create a new form e.g. default.aspx link it to a master page and the master page is linked to a css file (style sheet file) that contains only general and basic formatings and I hardly change any thing in this css file. I format my default.aspx. and later the formating chanegs by it self and I have to change it back manualy. Most of the time I have to create a new form. link it to the master page and copy the text, tables and so on from the original page to the new page and then delete the original page. but even the new page chnages later. and so on. I don't know how to avoid that! Any idea's? Thanks in advance  Michael Najar wishes you great day

Page Header, PrintOnFirstPage=False, HTML render fine, PDF export leaves extra space

As it says in the header.Setup:SSRS 2008, VS 2008 SP1Local Mode, rdlc fileDesign:Make a 1/2" Page header with a text box in it. Set PrintOnFirstPage=FalseBody contains a Table that spans multiple "hard" pages.Results:Renders to HTML in the report viewer just fine.PDF export leaves blank 1/2" at the top of page 1. With no header for page 1, I had hoped it would remove the extra space the same as in the report viewer.Question:Any way to tell SSRS not to leave space when page header is turned off for the first page?Attempts:Tried putting everything in a rectange in the header and set the visibility to false. Still leaves space.

Change label text on master page from the content page.

Hello. Can I access the objects (for example change the label text) on the master page, from its contents page code? If yes, how can I approach that? Thank you Artashes

Consistently running out of page file memory with full text indexer

Using MS SQL Server 2008 SP1 x64 Standard Edtion on Windows 2008 R2 Enterprise, I'm about to full-text index for the first time 1 table and 2 views. The table contains about 250'000 entries with a data space of 180 MB. As soon as I activate the full text indexing, the fdhost.exe task starts to consume slowly but surely all the available page file space (this can be easily watched using the Resource Monitor and the Commit Charge graph on the memory tab). Once all the virtual memory has been consumed, the server becomes unusable since it can't open any new windows any more, and RDP stops working. The machine specs are as follows: 12 GB of RAM 80 GB free on hard disk out of 136 GB 8 CPUs Custom size paging file with sizes between 24 GB - 60 GB (originally, this was system managed size, but then the server ran out of memory sooner) Max SQL server memory set to 6 GB (first 10 GB, then 8 GB) I've set the max fulltext crawl range to 8. During the indexing, the 8 CPUs are bit busy for a while, but not excessively. What is astonishing is that there is almost no use of physical memory during the indexing (I can see an increase from 2 GB to 3 GB which still leaves plenty of RAM available). Does anybody have an idea how I can convince fdhost.exe to consume physical memory and leave the paging memory alone? Or what else can I try?

Read a text file on another server from a web page

How do I read/write a text file on another server from a web page. I get the error "Access to the path '//Server2/mydatafiles/test.txt' is denied". I do not get the error if I am running the browser on the server where the files exist. I think I need to set permissions on the destination server in some way.   Can you help? Thanks  

Code inside page load is not executing.

  I am beginner to .Net development, so i am looking for a favour. Thanks a lot in advance!!!!!!! Question 1 :  protected void Page_Load(object sender, EventArgs e)    {        txtUserName.Text = "Focus";                txtUserName.Focus();            } I am unable to get focus to my textbox   Question 2 : I made javascript code for client side validation. function loginjs()        {            if(document.getElementById('txtUserName').value.length==0)            alert("UserName cannot be blank");            else if(document.getElementById('txtPassword').value.length==0)            alert("Password cannot be blank");                    } this code executes but it is not stopping further code execution. I mean it is only alerts but in addition to that i need to stop further execution.     &nbs

Problem passing a text box value from aspx.cs page to SelectParameters in aspx page

Hi,I would like to take a value from a text box and pass it as a search parameter to my database. I get the value from my code behind page as follows: protected void btn_click(Object sender, ImageClickEventArgs e)      {           AccessDataSource1.SelectParameters["inputValue"].DefaultValue = TextBox1.Text;           string test = AccessDataSource1.SelectParameters["inputValue"].DefaultValue;                      //string inputValue = TextBox1.Text;          //Response.Write(inputValue);         // AccessDataSource1.SelectParameters.Add("@name", inputValue);          //Response.Write(@inputValue);                              } protected void btn_click(Object sender, ImageClickEventArgs e)     {          AccessDataSource1.SelectParameters["inputValue"].DefaultValue = TextBox1.Text;          //An alternate option I have used is          //string inputValue = TextBox1.Text;         // AccessDataSource1.Selec

Inside Div text and background color not changing in HTML Tabs

there is below a I have Written a JAVAScript for TABS in HTML of div format and on anchor click the tab changes<script type="text/javascript"> function DisplayDiv(tabno){ var divnum; divnum=tabno; if(divnum == 1){ document.getElementById("div1").style.backgroundcolor="#D0DBF9"; document.getElementById("div2").style.backgroundcolor="#EFF3FE"; document.getElementById("div3").style.backgroundcolor="#EFF3FE"; document.getElementById("thisaudio").style.disply='block'; document.getElementById("comment").style.display='none'; document.getElementById("related").style.display='none'; } if(divnum == 2){ document.getElementById("div1").style.backgroundcolor="#EFF3FE"; document.getElementById("div2").style.backgroundcolor="#D0DBF9"; document.getElementById("div3").style.backgroundcolor="#EFF3FE"; document.getElementById("thisaudio").style.display='none'; document.getElementById("comment").style.display='block'; document.getElementById("related").style.display='none'; } if(divnum == 3){ document.getElementById("div1").style.backgroundcolor="#EFF3FE"; document.getElementById("div2").style.backgroundcolor="#EFF3F

Tab Panel inside a User control - null referance to text box with set properties

Hi guys, Im having problems with the following: I have a user control which has a tabbed panel inside, I then have a public property which populates a textbox inside the tabbed panel, HOWEVER when I access the property on my ASPX page, it give me a null referance to textbox, I have tried using findControl but still finds nothing, Please help!! ASPX PAGE  <Registration:UserDetails UserID="23" ID="RegistrationUserDetails" runat="server" /> USER CONTROL<cc1:TabContainer ID="TabContainerRegistration" runat="server" ActiveTabIndex="1" > <cc1:TabPanel runat="server" ID="TabPanelAccessDetails" HeaderText="Access details"> <ContentTemplate> <table> <tr> <td>User ID</td> </tr> <tr> <td><asp:TextBox ID="UserIDTextBox" ReadOnly="true" runat="server" SkinID="InputBoxes"></asp:TextBox></td> </tr> </table> </ContentTemplate> </cc1:TabPanel> </cc1:TabContainer> CODE BEHINDprivate int _UserID; public int UserID { set { TextBox tb = (TextBox)TabContainerRegistration.

Finding a control inside a ListView on a master page

I have a listview on a master page that ISN'T part of a content place holder that I want to fill in and disable if the user is already logged in. I have a label set up already which works fine. I'm just having problems accessing a Textbox by the name of "NameTextBox" in the InsertItem template of the listview.Here is the part of my codefile:Dim vCurrentUser As MembershipUser = Membership.GetUser() If Not vCurrentUser Is Nothing Then Dim pnl As Label = LoginView1.FindControl("Label1") pnl.Text = Page.User.Identity.Name Dim NameBox As TextBox = ListView1.InsertItem.FindControl("NameTextBox") NameBox.Text = Page.User.Identity.Name End IfI get a Object not found exception. What is the correct way to find a control inside a InsertItemTemplate and the correct Event to use?

Page Up/Page Down scrolling behaviour with listview inside scrollviews


I have a listview with many list items that is contained within a scrollviewer.

When I select the topmost item and hit the Page Down key, the scrollviewer scrolls along with the listview. The same thing happens for combo boxes.

Is this the expected behaviour because I expected only the listview to scroll?

Here is some sample code:

<Window x:Class="WpfApplication1.Window1"

Page Layout and Text Layout Buttons Disabled on Ribbon

I am trying to create a publish site in Sharepoint 2010, and I am using the Ribbon control.  Currently, I am having trouble adding and changing content on my site, due to both the Page Layout and Text Layout buttons being disabled.  I have been trying to figure out what security or feature needs to be active to get these enabled again.  Any help would be appreciated.

how to find any text in current page with java script like (CTRL + F) ie or firefox .



i have a page with datalist and more label

and i have an input text and a html button in my page.

i need a javaScript code for find text in my page like ( ctrl + f ) in ie or firefox . ?!


Dynamically added text boxes disappears after page refresh


Dim objDatabase As New database
        Dim objAdapter As SqlDataAdapter
        Dim objDataset As New DataSet
        Dim objAdapter1 As SqlDataAdapter
        Dim objDataset1 As New DataSet
        Dim objAdapter2 As SqlDataAdapter
        Dim objDataset2 As New DataSet

        objAdapter = New SqlDataAdapter("SELECT first_name + ' ' + last_name as [Name],father_mobile_no as [Father Mob No],mother_mobile_no as [Mother Mob No] FROM student_data WHERE class='" & cmb_class.SelectedValue & "' and division = '" & cmb_division.SelectedValue & "' and school_id='" & Session("school_id") & "'", objDatabase.con)
        objAdapter.Fill(objDataset, 0)
        If objDataset.Tables(0).Rows.Count > 0 Then

            Dim dt_table As DataTable

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