Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Threaded View

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

    Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

    I'm using vs 2010 and working on filtering data from a table. when i build my project then this message appears.May someone tell me how can i solve my problem?


    <%@ Page Language="C#" %>
     <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Xml.Xsl" %>
    <%@ Import Namespace="System.Xml" %>
    <%@ Import Namespace="System.Linq" %>
    <%@ Import Namespace="System.Data.SqlClient" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                var data = this.GetDataReader();
                var store1 = this.GridPanel1.GetStore();
                var store2 = this.ComboBox1.GetStore();
     
                store1.DataSource = data;
                store1.DataBind();
                
                store2.DataSource = data;
                store2.DataBind();
            }
        }
        private SqlDataReader GetDataReader()
        {
            SqlConnection myConnection;
            SqlCommand myCommand;
            SqlDataReader myDataReader;
    
            string strConn = System.Configuration.ConfigurationManager.ConnectionStrings["COI_TESTConnectionString"].ConnectionString;
    
            myConnection = new SqlConnection(strConn);
            myConnection.Open();
    
            myCommand = new SqlCommand("SELECT * FROM FndHistory", myConnection);
            myDataReader = myCommand.ExecuteReader();
    
            return myDataReader;
        }
    
       
        
    </script>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>GridPanel with MultiHeader Row Filters - Ext.NET Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />    
     
        <script type="text/javascript">
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
         
        <ext:XScript ID="XScript1" runat="server">
            <script type="text/javascript">
                             
                var applyFilter = function (field) {                
                    var store = #{GridPanel1}.getStore();
                    store.suspendEvents();
                    store.filterBy(getRecordFilter());                                
                    store.resumeEvents();
                    #{GridPanel1}.getView().refresh(false);
                };
                 
                var clearFilter = function () {
                    #{ComboBox1}.reset();
                    #{PriceFilter}.reset();
                    #{ChangeFilter}.reset();
                    #{PctChangeFilter}.reset();
                    #{LastChangeFilter}.reset();
                     
                    #{Store1}.clearFilter();
                }
     
                var filterString = function (value, dataIndex, record) {
                    var val = record.get(dataIndex);
                    
                    if (typeof val != "string") {
                        return value.length == 0;
                    }
                    
                    return val.toLowerCase().indexOf(value.toLowerCase()) > -1;
                };
     
                var filterDate = function (value, dataIndex, record) {
                    var val = record.get(dataIndex).clearTime(true).getTime();
     
                    if (!Ext.isEmpty(value, false) && val != value.clearTime(true).getTime()) {
                        return false;
                    }
                    return true;
                };
     
                var filterNumber = function (value, dataIndex, record) {
                    var val = record.get(dataIndex);                
     
                    if (!Ext.isEmpty(value, false) && val != value) {
                        return false;
                    }
                    
                    return true;
                };
     
                var getRecordFilter = function () {
                    var f = [];
     
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{ComboBox1}.getValue(), "company", record);
                        }
                    });
                     
                    f.push({
                        filter: function (record) {                         
                            return filterNumber(#{PriceFilter}.getValue(), "price", record);
                        }
                    });
                     
                    f.push({
                        filter: function (record) {                         
                            return filterNumber(#{ChangeFilter}.getValue(), "change", record);
                        }
                    });
                     
                    f.push({
                        filter: function (record) {                         
                            return filterNumber(#{PctChangeFilter}.getValue(), "pctChange", record);
                        }
                    });
                     
                    f.push({
                        filter: function (record) {                         
                            return filterDate(#{LastChangeFilter}.getValue(), "lastChange", record);
                        }
                    });
     
                    var len = f.length;
                     
                    return function (record) {
                        for (var i = 0; i < len; i++) {
                            if (!f[i].filter(record)) {
                                return false;
                            }
                        }
                        return true;
                    };
                };
            </script>
        </ext:XScript>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />        
             
            <ext:GridPanel
                ID="GridPanel1"
                runat="server"
                StripeRows="true"
                Title="Array Grid"
                TrackMouseOver="true"
                Width="600"
                Height="350"
                AutoExpandColumn="Company">
                <Store>
                    <ext:Store ID="history" runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="company" />
                                    <ext:RecordField Name="price" Type="Float" />
                                    <ext:RecordField Name="change" Type="Float" />
                                    <ext:RecordField Name="pctChange" Type="Float" />
                                    <ext:RecordField Name="lastChange" Type="Date" DateFormat="MM/dd/yyyy" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="company" />
                        <ext:Column Header="Price" Width="75" DataIndex="price">
                            <Renderer Format="UsMoney" />
                        </ext:Column>
                        <ext:Column Header="Change" Width="75" DataIndex="change">
                            <Renderer Fn="change" />
                        </ext:Column>
                        <ext:Column Header="Change" Width="75" DataIndex="pctChange">
                            <Renderer Fn="pctChange" />
                        </ext:Column>
                        <ext:DateColumn Header="Last Updated" Width="95" DataIndex="lastChange" />
                        <ext:Column Width="28" DataIndex="company" Sortable="false" MenuDisabled="true" Header="&nbsp;" Fixed="true">
                            <Renderer Handler="return '';" />
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                 
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
                </SelectionModel>
                 
                <View>
                    <ext:GridView ID="GridView1" runat="server">
                        <HeaderRows>
                            <ext:HeaderRow>
                                <Columns>
                                    <ext:HeaderColumn Cls="x-small-editor">
                                        <Component>
                                            <ext:ComboBox 
                                                ID="ComboBox1" 
                                                runat="server"
                                                TriggerAction="All"
                                                Mode="Local"
                                                DisplayField="company"
                                                ValueField="company">
                                                <Store>
                                                    <ext:Store ID="Store1" runat="server">
                                                        <Reader>
                                                            <ext:ArrayReader>
                                                                <Fields>
                                                                    <ext:RecordField Name="company" />
                                                                </Fields>
                                                            </ext:ArrayReader>
                                                        </Reader>
                                                    </ext:Store>
                                                </Store>
                                                <Listeners>
                                                    <Select Handler="applyFilter(this);" />
                                                </Listeners>     
                                            </ext:ComboBox>
                                        </Component>
                                    </ext:HeaderColumn>
                                     
                                    <ext:HeaderColumn Cls="x-small-editor">
                                        <Component>
                                            <ext:TextField ID="PriceFilter" runat="server" EnableKeyEvents="true">
                                                <Listeners>
                                                    <KeyUp Handler="applyFilter(this);" Buffer="250" />                                                
                                                </Listeners>
                                            </ext:TextField>
                                        </Component>
                                    </ext:HeaderColumn>
                                     
                                    <ext:HeaderColumn Cls="x-small-editor">
                                        <Component>
                                            <ext:TextField ID="ChangeFilter" runat="server"  EnableKeyEvents="true">
                                                <Listeners>
                                                    <KeyUp Handler="applyFilter(this);" Buffer="250" />
                                                </Listeners>
                                            </ext:TextField>
                                        </Component>
                                    </ext:HeaderColumn>
                                     
                                    <ext:HeaderColumn Cls="x-small-editor">
                                        <Component>
                                            <ext:TextField ID="PctChangeFilter" runat="server"  EnableKeyEvents="true">
                                                <Listeners>
                                                    <KeyUp Handler="applyFilter(this);" Buffer="250" />
                                                </Listeners>
                                            </ext:TextField>
                                        </Component>
                                    </ext:HeaderColumn>
                                     
                                    <ext:HeaderColumn Cls="x-small-editor">
                                        <Component>
                                            <ext:DateField ID="LastChangeFilter" runat="server" Editable="false">
                                                <Listeners>
                                                    <Select Handler="applyFilter(this);" />
                                                </Listeners>
                                            </ext:DateField>
                                        </Component>                                    
                                    </ext:HeaderColumn>
                                                                   
                                    <ext:HeaderColumn AutoWidthElement="false">
                                        <Component>
                                            <ext:Button ID="ClearFilterButton" runat="server" Icon="Cancel">
                                                <ToolTips>
                                                    <ext:ToolTip ID="ToolTip1" runat="server" Html="Clear filter" />
                                                </ToolTips>
                                                 
                                                <Listeners>
                                                    <Click Handler="clearFilter(null);" />
                                                </Listeners>                                            
                                            </ext:Button>
                                        </Component>
                                    </ext:HeaderColumn>
                                </Columns>
                            </ext:HeaderRow>
                        </HeaderRows>
                    </ext:GridView>
                </View>
            </ext:GridPanel>  
        </form>
    </body>
    </html>
    Last edited by geoffrey.mcgill; Feb 05, 2012 at 2:46 PM. Reason: please use [CODE] tags

Similar Threads

  1. Replies: 4
    Last Post: Feb 01, 2011, 11:54 AM
  2. Replies: 0
    Last Post: Dec 27, 2009, 1:47 PM
  3. Replies: 0
    Last Post: Sep 05, 2009, 8:52 AM
  4. Replies: 2
    Last Post: Aug 31, 2009, 6:03 PM
  5. System Security Exception
    By jaydwire2 in forum 1.x Help
    Replies: 0
    Last Post: Jul 31, 2009, 3:38 PM

Posting Permissions