iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
<%@ 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
Thanks for your help Hans.
I had not tried to enable SmartWebResources. I had planned to simply copy the CommonLibrary folder structure to be application folder. It seemed to load other images and scripts but not the two that I mentioned. When I place the resource dll files in the bin folder and add the handler information to my web.config as you did, it works. I can implement either way but shouldn't it have worked without having the resource dlls in place and the handler section in the web.config?
I didn't see that I needed to set the source on the DataSourceEventArgs. Thanks. I saw in the examples in the help document
I had a typo. Thanks for that also.
Hi Keith,
I think it can be implemented without WebCombo.Resources.dll in Bin folder but some of our resources had been hard coded in our code. So I think it will be safer if you put WebCombo.Resources.dll in you bin folder. For DataSourceEventArgs in InitializeDataSource, I think you should use this variable in InitializeDataSource event to directly change the DataSource for WebCombo. Although, in some event like page load, you can use webCombo.DataSource to change the data source in WebCombo. Hope this helps.
Regards,Bernard
Thanks. I had kinda figured that was the case.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname