This is a migrated thread and some comments may be shown as answers.

my html tags changes auto

1 Answer 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
hsoein
Top achievements
Rank 1
hsoein asked on 25 Nov 2015, 10:18 AM

i use rad editor but when i write code on it for example :

<a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">

<div class="img"><a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما"><img width="260" height="216" src="Templates/Banner/BaranWeb/rtl/PageAsli/img/Pic2.jpg" alt="تاثیر وب سایت در کار شما" title="تاثیر وب سایت در کار شما" /></a></div>
<div class="info baranw_font_12pt"><a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">
</a>

 

it changes to

<a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">
</a>
<div class="img"><a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما"></a><a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما"><img src="Templates/Banner/BaranWeb/rtl/PageAsli/img/Pic2.jpg" alt="تاثیر وب سایت در کار شما" title="تاثیر وب سایت در کار شما" height="216" width="260"></a></div>
<div class="info baranw_font_12pt"><a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">
</a></div>

 

i want to save content in database i write ...without any changes my tag .

i read your forum i test this code :ContentFilters="none" and also test 

     RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertToXhtml);
            RadEditor1.EnableFilter(EditorFilters.None);

and another thing but any one dont work please help me ????????????

how can i get my tag without any changes????????????????????

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 26 Nov 2015, 07:16 AM
Hi,

The shown HTML content is not valid. Anchor tags are inline elements and cannot have children that are block element. Like Div tags. You can find here a discussion on the same topic—http://stackoverflow.com/questions/1827965/is-putting-a-div-inside-an-anchor-ever-correct.

Also, if you test the same scneario with a plain HTML document by putting this HTML, alerting the innerHTML of the container shows the same behavior. 

<div id="test">
    <a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">
        <div class="img">
            <a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">
                <img width="260" height="216" src="Templates/Banner/BaranWeb/rtl/PageAsli/img/Pic2.jpg" alt="تاثیر وب سایت در کار شما" title="تاثیر وب سایت در کار شما" />
            </a>
        </div>
        <div class="info baranw_font_12pt"><a href="default.aspx?PID=تاثير وب سايت در کسب و کار شما">
    </a>
</div>
 
<a href="#" onclick="alert(document.getElementById('test').innerHTML); return false;">test</a>

The example above shows that it is the browser that tries to correct the HTML inserted as best as it can. Therefore, it closes the tags where it seems more appropriately as per to its own browser filters.

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
hsoein
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or