Automatic Insert/Update of the value in textbox fails when I put in the HTML document in the textbox

2 posts, 0 answers
  1. Yuriy
    Yuriy avatar
    13 posts
    Member since:
    Jul 2011

    Posted 23 Feb 2012 Link to this post


    I have RadGrid with automatic Insert/Update. Everything is working just fine, the problems start occurring, when I try to save html document using the textbox, giving me "server error".  See below my asp markup and the doc I try to save.


    <telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                        AllowAutomaticUpdates="True" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="ServiceType"
                        GridLines="None" ShowStatusBar="True" AllowPaging="True">
                        <PagerStyle AlwaysVisible="true" Mode="NumericPages" />
                                <DataService Type="OData" />
                            <Selecting AllowRowSelect="True" />
                        <MasterTableView CommandItemDisplay="Top" DataKeyNames="ServiceTypeID"
                            DataSourceID="ServiceType" Width="100%" Name="ServiceType"
     <telerik:GridTemplateColumn DataField="MaterialDescription" FilterControlAltText="Filter MaterialDescription column"
                                                            HeaderText="Description" UniqueName="ChildMaterialDescription">
                                                                <asp:TextBox ID="MaterialDescriptionTextBox" runat="server" Text='<%# Bind("MaterialDescription") %>'
                                                                    Height="100px" TextMode="MultiLine" Width="300px" Wrap="True"></asp:TextBox>
                                                                <asp:Label ID="MaterialDescriptionLabel" runat="server" Text='<%# Eval("MaterialDescription") %>'></asp:Label>
     <asp:SqlDataSource ID="ChildMaterialItems" runat="server" ConnectionString="<%$ ConnectionStrings:KPortal %>"
        SelectCommand="SELECT Materials.ParentMaterialID, Materials.MaterialID, Materials.MaterialDescription, Materials.MaterialName, Materials.MaterialPictureID, MaterialPictures.PictureCategory + ' - ' + MaterialPictures.PictureDescription AS PictureDescription, Materials.PricedItem, Materials.MaterialCategoryID, Materials.OrderID, Materials.Value, Materials.UnitID, Materials.InternalCode, Materials.UnitType FROM Materials INNER JOIN MaterialPictures ON Materials.MaterialPictureID = MaterialPictures.MaterialPictureID WHERE (Materials.ParentMaterialID = @ParentMaterialID)
    order by Materials.OrderID" DeleteCommand="Exec DeleteMaterials @MaterialID"
            InsertCommand="Exec InsertMaterial
    @MaterialPictureID = @MaterialPictureID,
    @ParentMaterialID = @ParentMaterialID,
    @MaterialName = @MaterialName,
    @PricedItem = @PricedItem,
    @InternalCode = @InternalCode ,
    @Value = @Value,
    @UnitType = @UnitType,
    @UnitID = @UnitID,
    @OrderID = @OrderID"
    Update Materials
    MaterialDescription = @MaterialDescription,
    MaterialPictureID = @MaterialPictureID,
    MaterialName = @MaterialName,
    PricedItem = @PricedItem,
    InternalCode = @InternalCode,
    Value = @Value,
    UnitType = @UnitType,
    UnitID = @UnitID,
    OrderID = @OrderID
    Where MaterialID =@MaterialID
                <asp:Parameter Name="MaterialID" />
                <asp:Parameter Name="MaterialDescription" />
                <asp:Parameter Name="MaterialPictureID" />
                <asp:Parameter Name="ParentMaterialID" />
                <asp:Parameter Name="MaterialName" />
                <asp:Parameter Name="PricedItem" />
                <asp:Parameter Name="InternalCode" />
                <asp:Parameter Name="Value" />
                <asp:Parameter Name="UnitType" />
                <asp:Parameter Name="UnitID" />
                <asp:Parameter Name="OrderID" />
                <asp:ControlParameter ControlID="RadGrid2" Name="ParentMaterialID"
                    PropertyName="SelectedValue" />
                <asp:Parameter Name="MaterialDescription" />
                <asp:Parameter Name="MaterialPictureID" />
                <asp:Parameter Name="MaterialName" />
                <asp:Parameter Name="PricedItem" />
                <asp:Parameter Name="InternalCode" />
                <asp:Parameter Name="Value" />
                <asp:Parameter Name="UnitType" />
                <asp:Parameter Name="UnitID" />
                <asp:Parameter Name="OrderID" />
                <asp:Parameter Name="MaterialID" />

    I am trying to save in the column above the following text:
        <p style="text-align: left">
            <img alt="Priceology"  src="{WebSiteAddress}/Pics/Pricology640.jpg" /></p>
                Dear {CompanyUserName},<br />
                <br />
                Please be advised that there is an update to {Service} project that you are
                working on.<br />
                <br />
                The status of the <b>"{ProjectName}"</b> project have been updated to
                <br />
                <br />
                Please visit the link below to see the details:e the details:<br />
                <br />
                 <a href="{ManufacturerProjectLink}">Priceolgy projects</a><br />
                <br />
                Regards,<br />
                Priceology Team</div>
  2. Iana Tsolova
    Iana Tsolova avatar
    3388 posts

    Posted 24 Feb 2012 Link to this post

    Hello Yuriy,

    You cannot enter HTML in a textbox. This is not allowed for security purposes. You can try using our HTML Editor intead:

    Kind regards,
    Iana Tsolova
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top