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


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Publishing HTML and RichTextField display HTML code - not rendering

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#
 

Hi there, 

I have several custom columns of type "Publishing HTML", and a page layout several controls which point to the columns. :

<SharePointWebControls:RichTextField DisableInputFieldLabel="True"  FieldName="WheelImage" runat="server"></SharePointWebControls:RichTextField>

 

The problem is that in the end result, the page shows escaped HTML (eg. <p></p>) rather than the rendered output I would expect. 

 

Oddly - when it edit mode - they render fine, showing the rendered output. But in the 'reader' view, it shows the raw HTML. 

 

I have also checked the 'edit html source' in edit mode - and it looks fine, like HTML. But the browser source of the output page shows escaped html: &lt;br/&gt;

 

I found this describing the same problem, but its not a solution - as this happens on any browser:

 

http://social.msdn.microsoft.com/Forums/en/sharepointgeneral/thread/a7ab3a61-6643-4a47-a464-fe46b5db1558

 

Anyone any ideas?

 

Thanks

 

Mike

 




View Complete Post


More Related Resource Links

PublishingWebControls:RichImageField show html code for the image instead of rendering the image

  

I am modifying the article page layout to display more than one image. The rendered page does not show the image. Its showing the <img> tag instead.

Please help!


Rendering ASP.NET Script References into the Html Header

  
One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

Rendering data with HTML tags in the DD Gridview for a selected column

  

I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                // Html Encode the cells
            }

        }

but this event never fires?


Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!


dynamically change html code when user is authenticated

  

So I have a fairly simple web site which allows an Administrator to edit some data in a database which is displayed on some web pages.


The main navigation on the site is shown in the code snippet below. The Admin link goes to a Login.aspx which allows the Administrator to log in - once authenticated they get sent to the data edit page.

So my question is, how could I dynamically add a link to the data edit page in the <ul> list below once the user is authenticated ?

This would allow the authenticated user to see links to the secure pages in the main navigation bar.


<%--Top Navigation Menu --%>
<div id="topMenu">
<ul>
<li><a href="default.aspx">Home</a></li>
<li><a href="introduction.aspx">Introduction</a></li>
<li><a href="curriculum.aspx">Curriculum</a></li>
<li><a href="times.aspx">Times & Fees</a></li>
<li><a href="staff.aspx">Staff</a></li>
<li><a href="login.aspx">Admin</a></li>
</ul>
</div><%--End of topMenu Container--%>
<div id="clear"></div><%--Floats items cleared End of Master Page--%>


How do I change the default HTML code for a collection of lists and views

  

I have modified the html display code of some lists and content query web parts in SharePoint designer.  This works well when modifying a few lists, but I have many lists and different views with these many lists.

Is there a way to modify the template code for a site so that all my lists, views and CQWPs display identically with my modified code?  Managing these individually is not practical.


VB.NET - store HTML code in SQL Server

  

Hey guys/gals!!

Quick question - I want to allow someone to enter HTML markup in a control, and save the input exactly as entered. 

I want people to put a minimum of 50 words, to maximum of 500, and be able to save the formatting of their text in SQL 2005 server database. 


Also, I understand this is two questions, but how do I save metadata of an image file in the sql database? I mean, I get the gist of it, but how do I do it? 


Thanks everyone!


Extract text from html source code

  
i wan to extract Desired Title,Desired Text and Desired link from Webpage source code and paste in richTextBox1. <a href="/site/show/link/0/type/0">Desired Titl e</a> <a title="&lt;b&gt;Text preview&lt;/b&gt; &lt;br/&gt;Some Text" class="pdtip" href="/site/show/link/0/type/0">Text</a><br />Desired text <br /> <label class="url" for="">http://Desiredlink.com </label> Output: Desired Title Desired Title Desired link How can i do this?

How to handle differences in HTML code from different browser versions?

  
First of all I'm still very new to C# so be gentle :p I'm currently trying to make an application that can login to a certain website and search for some numbers and so on that I can put in an overview, just to save some time. The only thing I found that could do this is the WebBrowser control, and I've managed to make it work, but when I gave the program to a friend it failed. I think it has to do with the difference in browser versions (he uses Internet Explorer 7, I use the latest) and if that's the case I'm pretty clueless how to deal with the problem, since I don't even know what the differences in HTML codes are in each version, and it seems like a lot of work to adjust all the html code to check for accordingly. For example it was even so that & changed to &amp; in my application on my PC and that's only by using one browser so I dunno what happens with other browser versions. I assume that the WebBrowser control always uses Internet Explorer, even if for example Firefox is the standard browser, is this true? But to be sure I asked the friend to put his Internet Explorer as the default browser and still no go. So my question is: is there a relatively easy way to make sure that the program works on practically any PC, without me having to make exceptions for like version 1.6.7 or 1.6.8 (I have no idea what versions there are really)?

Firexfox and SharePoint Forum - a reply shows html code

  
When users use Firefox to view SharePoint and are replying to a post of the forum\discussion board the reply box and view box already has the HTML code in. For instance the body field contains:- <div><br/><br/><hr/> <b>From: </b>Kevin Shilling<br/> <b>Posted: </b>03 August 2010 15:17<br/> <b>Subject: </b>CHRISTMAS IS COMING...<br/><br/> <div>Yes, I know it is only August but thinking ahead what do you think about hosting our annual Open Evening for local neighbours, suppliers and friends and family. Do you think it is a good idea or not? Let me have your thoughts before the end of September when planning usually starts.</div></div> Anyone come across this and found a fix? Regards Mike

Rich text field showing html code

  
I am an end user of Sharepoint. This issue only happens from my computer, not from any other within our organization. What happens is that when I edit an item in Sharepoint that contains a rich text field, HTML code is showing. Like so: <div class=ExternalClassC900CFF4F2BF4312A89133C01A6E3C96> Some text</div> This happens from any web browser. Sharepoint 2007 is used. I have Windows 7 x64. Any idea what is causing this?

display codes (asp or html) on web page

  
hello.....i am wishing to display asp or html codes on my web page. actually i am working on article project and article includes codes too. still i am using <iframe> but not looking soo good.i am also wishing to dispaly codes in a way that can be expand or collapsed using (+) sing, as you also know. or tell me any alternative to accomplish. thanks in advance

How to dynamically create HTML file from the code ?

  
Hi all,Precisely and concisely, I have aspx page that has only one button "Generate". If the user clicked on this button, one HTML page should be created. The created HTML page should have title "Home" and the Body should contain "Hello World". 1) What is the code that should be written inside "Generate" button in order to accomplish this functionality? 2) Assuming the HTML page gets created, How to store it inside specific folder on the local drive? Or how to store it inside DB? I would greatly appreciate any constructive input!

Razor. Display conditional Html

  
Hello,I have the following code on a View using Razor view engine: @if(View.Section == CMSSection.Home) { Html.ActionLink("Home", MVC.CMS.Home.Index()) } else { <span>Home</span> }I keep getting the error:Compiler Error Message: CS1002: ; expectedWhat am I missing?Thank you,Miguel

Publishing HTML Field with External List

  
I have an external content type I created and an external list that I provisioned off of the content type.  I want to customize how the user edits some of these columns.  I need one of my list columns to be a field type "image" and one to be a field type of "HTML".  I tried exporting the list as an wsp and importing into an empty sharepoint project.  When I review the custom schema.xml for the list I can see the fields referenced from the externa content type.  I altered these fields so that they conform to the types I need.  For some reason when I deploy the list definition and instance those fields are still textboxes.  I have googled this topic and there doesn't seem to be much out there.  Does anyone have any idea as to how I can accomplish this.  I originally wanted to build my list structures out in sharepoint but there are many parent child relationships and after realizing I cannot create a lookup type field that references a sharepoint list declaritively in CAML due to the fact that the listid has not been created because it hasn't been provisioned I abandoned that concept and put my tables in a SQL database.  I need the user to be able to associate a sharepoint image and some HTML in a couple of columns in this table.

The difference between code behind and front side html

  

Hi,

This is a basic understanding I miss, 

On our aspx page most actions can be done from code behind or from aspx.cs page 

If it is done from aspx.cs page then there is no access to the code , unlike Javascript, css or plain html, for example changing font color can be done both ways:

In code behind:  lblMessage.ForeColor = Drawing.Color.DarkRed

Or in html: style="font-family:verdana;color:DarkRed"

when should I be using code behind and when html?

If the only difference is privacy then why not using only code behind?



How can i save HTML code with developer tools??

  

Hello, all

to insurt pics and change colors in webparts, i changed some HTML code and CSS classes in developer tool. and it works perfect. but the problem is i don't know how to save the code i changed, everytime i went to the other web or close the develop tool, the web i changed will turn to the original one.

there is save button in developer tools, but the file i saved was TXT file rather than HTML file. i know may be i can change it to HTML file directly, but after changed, what i should do, i don't where sharepoint saved all of its html files?? is there any folder that sharepoint use to keep all of it's code??

Thank you inadvance

Yuyu


How can i save HTML code with developer tools??

  

Hello, all

to insurt pics and change colors in webparts, i changed some HTML code and CSS classes in developer tool. and it works perfect. but the problem is i don't know how to save the code i changed, everytime i went to the other web or close the develop tool, the web i changed will turn to the original one.

there is save button in developer tools, but the file i saved was TXT file rather than HTML file. i know may be i can change it to HTML file directly, but after changed, what i should do, i don't where sharepoint saved all of its html files?? is there any folder that sharepoint use to keep all of it's code??

Thank you inadvance

Yuyu


Categories: 
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