my html tags changes auto

2 posts, 0 answers
  1. hsoein
    hsoein avatar
    1 posts
    Member since:
    Nov 2015

    Posted 25 Nov 2015 Link to this post

    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????????????????????

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 26 Nov 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top