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
I am trying to bind webcombo dynamically. In the page_load event on server side i don't have the information needed to load webcombo data, i have it on client-side. I saw that it was possible to bind combo to webmethod in webservice, but is it possible to bind it to webmethod on .aspx page on which the combo itself is contained.
My problem is that i need to dynamically rebind webcombo on client depending on some input. So when users clicks on different menu options I have to load different data in combo. Is that even possible, and if yes, can someone please give me a working example. I am getting data from stored procedure in sql server. Is there a way, please help!
Hi Nikola,
In my sample, I'm using Data Context that automatically built from LINQ to SQL Classes item (dbml). You can see the connection definition in Northwind.designer.cs inside Northwind.dbml. You can use aspx with WebMethod like you mentioned above. You can also define the stored procedure for data retrieval inside it as long as you can access the custom class in WebMethod to get the data. For references, you can look the sample in our WebCombo sample about client binding. And to refresh the value inside ResultBox, you can put the same way like in my sample.
WebCombo2.IsDirty = true; WebCombo2.NeedClearList = true; WebCombo2.Values = null; WebCombo2.ClearSelection(); WebCombo2.RefreshValueItems();
Hope this helps.
Regards,Bernard
Got it, thanks.
Hi Nicola,
To achieve your scenario, I've made you an sample. You can download the sample here.
To refresh Client Binding WebCombo using this script. When you select the first WebCombo, second WebCombo will refresh its value. Hope this helps.
I guess the webservice can just be replaced with aspx that has a webmethod on it.
This part with northwind database confuses me, can you please show me how webmethods would look if you had a connection to sql server and stored procedure for data retrieval.
<ClientBindingSettings DataSourceType="WebService" ServiceUrl="MyPageName.aspx"> <ServiceMethods SelectMethod="WebMethodName" /> </ClientBindingSettings>
It can't be done if you define WebMethod in System.Web.UI.Page class. You should put it inside WebService class. That's why we need .asmx as Web Service inside your project. Web Service itself have code behind that held WebMethod to get QueryResult. Although, DataSourceSelectArguments will automatically parsed from WebCombo to WebMethod when selecting. However, you can't return a DataTable in ClientBinding with WebService. Also for the snippet code above, the snippet code is not correct because it has WebService as DataSourceType and it will refer to asmx file as WebService. Hope this helps.
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