[CLOSED] SelectBox: Problem with characters "<" and ">"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] SelectBox: Problem with characters "<" and ">"

    Hi,

    I am having some issue with characters "<" and ">" in the SelectBox.
    If I use "<abc><def>", it will not be displayed in the List, but it will be displayed in the SelectBox properly.
    If I use "&lt;ghi&gt;", it will be correctly displayed in the List as "<ghi>" but it will be incorrectly displayed in the SelectBox as "&lt;ghi&gt;".

    Can you advice how I can show values that contain "<" and ">" for both the SelectBox and the List?

    Complete HTML:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="WebApplication.ExtNet.Trending.Test" ValidateRequest="false" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <html>
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
    
    <ext:ResourceManager ID="ResourceManager_Trending" runat="server" IDMode="Explicit" />
    <ext:SelectBox ID="SelectBox1" runat="server" ValueField="Code" DisplayField="Description" Width="120">
      <Store>
        <ext:Store ID="storeSelectBox1" runat="server">
          <Reader>
            <ext:ArrayReader>
              <Fields>
                <ext:RecordField Name="Code" />
                <ext:RecordField Name="Description" />
              </Fields>
            </ext:ArrayReader>
          </Reader>            
        </ext:Store>    
      </Store>
    </ext:SelectBox>
    
        </form>
    </body>
    </html>
    Complete Server-Side Codes:
    using System;
    using Ext.Net;
    
    namespace WebApplication.ExtNet.Trending
    {
        public partial class Test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                object[] datasource = new object[3];
                datasource[0] = new object[] { 1, "Value 1" };
                datasource[1] = new object[] { 2, "<abc><def>" };
                datasource[2] = new object[] { 3, "&lt;ghi&gt;" };
                var store = this.SelectBox1.GetStore();
                store.DataSource = datasource;
                store.DataBind();
            }
        }
    }
    Last edited by Daniil; Nov 03, 2011 at 6:50 AM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] How does "MaskCls" work for "AutoLoad" mask in panel control
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 19, 2012, 12:09 PM
  2. Replies: 1
    Last Post: Jun 26, 2012, 11:29 AM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  5. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM

Tags for this Thread

Posting Permissions