Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 843 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InnerHTML attribute Shows The Tags at String

#1
Hello Im Developing a Simple Cms That Generate Blogs
however, The User Should enter The Blog Content buy im self and let him to do that with tinymce editor Now i save The Content OF that in a data base he Type of that database element is "Text" so far so good Right ?
the problem is when i get the Content from the data base and a sign it with inner HTml it became like in that picture[`Here`][1]
Here is the Html Code


[1]:



<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->


`boddy.InnerHtml = " <div id='shareButtonsDiv'><div class='iframe_header'>
<p>" & DetailsView1.Rows(0).Cells(1).Text & "</p>
<span class='social_icons'>
<span>Share on</span>
<span class='twitter'>
<a target='_blank' class='twitter-share-button'
href='https://twitter.com/share'
data-size='large'
data-text='custom share text'
data-url='https://dev.twitter.com/web/tweet-button'
data-hashtags='example,demo'
data-via='twitterdev'
data-related='twitterapi,twitter'>
<i class='fa fa-twitter' aria-hidden='true'></i></a>
</span>
<span class='facebook'>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return; js = d.createElement(s); js.id = id;
js.src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8&appId=1074461072666302';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class='fb-share-button' data-href='../blogs/1_1.html' data-layout='button' data-mobile-iframe='true'> <a class='fb-xfbml-parse-ignore' target='_blank' href='https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&src=sdkpreparse'>Share</a>
</div>
</span>
</span>
</div>

</div>

<div class='iframe_content'>
<div class='texts'>

" + DetailsView1.Rows(2).Cells(1).Text + "

</div>

</div> "`


<!-- end snippet -->

Reply

#2
It would seem that your HTML code is escaped/encoded. Try using the [**`HttpUtility.HtmlDecode()` method**](

[To see links please register here]

):

Dim Header As String = HttpUtility.HtmlDecode(DetailsView1.Rows(0).Cells(1).Text)
Dim Texts As String = HttpUtility.HtmlDecode(DetailsView1.Rows(2).Cells(1).Text)

...then concatenate the HTML with those two variables instead.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through