Images Not Found

4 replies. Last post: November 19, 2013 12:46 PM by Keith Johnson
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
I have a sample page where I am attempting to create a WebCombo programmatically.  I've also added another WebCombo directly on the page.   When the page initially loads, I get 404 errors on DD4_Over.gif and DD4_Active.gif because it is trying to find them in ISRes.axd.  However, arrow_black.gif is located correctly in the CommonLibrary/Images folder, which I have copied to my project folder.

Here is my page code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebComboTest.Default" %>
<%@ Register Assembly="ISNet.WebUI.WebCombo" Namespace="ISNet.WebUI.WebCombo" TagPrefix="ISWebCombo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div style="height:200px">
            Runtime: 
            <div style="height:200px">
                <asp:PlaceHolder ID="wc" runat="server"></asp:PlaceHolder>
            </div>
        </div>
        <div style="clear:both; margin-top:20px; ">
            On Page: 
            <div>
                <ISWebCombo:WebCombo ID="webCombo1" runat="server" UseDefaultStyle="true"></ISWebCombo:WebCombo>
            </div>
            <asp:Button ID="Button1" runat="server" Text="Load From List" onclick="Button1_Click" />
        </div>
    </form>
</body>
</html>

  The code behind, which is completely commented out at the moment is a combination of examples I've found on here:


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ISNet.WebUI.WebCombo;
namespace WebComboTest
{
    public class Default : System.Web.UI.Page
    {
        protected PlaceHolder wc;
        List<KeyAndValue> data = new List<KeyAndValue>();
        protected WebCombo webCombo1;
        List<Person> allUsers = new List<Person>();
        public class Person
        {
            public string id { get; set; }
            public string name { get; set; }
            public string email { get; set; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //WebCombo combo = new WebCombo("combo");
                //combo.Width = Unit.Pixel(200);
                //combo.Height = Unit.Pixel(20);
                //combo.UseDefaultStyle = true;
                //combo.InitializeDataSource += combo_InitializeDataSource;
                //combo.InitializeLayout += combo_InitializeLayout;
                //wc.Controls.Add(combo);
                //allUsers.Add(new Person { id = "1", name = "Alvin", email = "alvin@email.com" });
                //allUsers.Add(new Person { id = "2", name = "Mario", email = "mario@email.com" });
                //allUsers.Add(new Person { id = "3", name = "Martin", email = "martin@email.com" });
                //combo.DataBind();
            }
        }
        void combo_InitializeLayout(object sender, LayoutEventArgs e)
        {
            //WebCombo combo = (WebCombo)sender;
            //combo.DataTextField = "Key";
            //combo.DataTextField = "Value";
        }
        void combo_InitializeDataSource(object sender, DataSourceEventArgs e)
        {
            //WebCombo combo = (WebCombo)sender;
            //data.Add(new KeyAndValue { Key = "One", Value = 1 });
            //data.Add(new KeyAndValue { Key = "Two", Value = 2 });
            //data.Add(new KeyAndValue { Key = "Three", Value = 3 });
            //data.Add(new KeyAndValue { Key = "Four", Value = 4 });
            //data.Add(new KeyAndValue { Key = "Five", Value = 5 });
            //combo.DataSource = data;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //webCombo1.DataSource = allUsers;
            //webCombo1.DataTextField = "name";
            //webCombo1.DataValueField = "id";
            //webCombo1.DataBind();
        }
    }
    public class KeyAndValue
    {
        public string Key { get; set; }
        public int Value { get; set; }
    }
}

 


My web.config is as follows:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <configSections>
    </configSections>
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>
    <appSettings file="">
        <clear />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.ViewStateStorage" value="None" />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.ViewStateItems" value="Behavior" />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.CachePriority" value="Normal" />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.RunTimeLicenseKey" value="?????-????-?????" />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.SharedScriptDirectory" value="~/CommonLibrary/Shared/" />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.ScriptDirectory" value="~/CommonLibrary/WebCombo/V6_0_7200/" />
        <add key="ISNet.WebUI.WebCombo.v6_0_7200.ImagesDirectory" value="~/CommonLibrary/Images/" />
    </appSettings>
</configuration>

 

Can anyone tell me why these images not being loaded correctly?


Also, when the code behind is uncommented, the data is loaded, but the WebCombo boxes both say "loading...' when the down arrow is clicked.  Any idea as to why?


Thanks,

Keith

All times are GMT -5. The time now is 9:50 AM.
Previous Next