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
My WebCombo is set to AutoPostBack.
When user selected a value in the WebCombo, the page will be autopostback multiple time.
The 1st time it autopostback WebCombo.SelectedRow has the value, but the last time it autopostback WebCombo.SelectedRow is nothing.
Pls advise.
Hi Way Hang Wee,
From what I see on you code, you have created a connection object by yourself which I am not sure on how its works. So in here, I attach you a simple running sample using a SqlConnection for you to modified it according to your scenario.
I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.
Best Regards,
Andi Santoso
Sorry but I am having a trouble to replicate your issue. I have tried to summon a WebCombo with AllowAutoPostBack to true and in fact, I also use a FullPostBack Button to test if it will trigger the random autopostback but the result is not, it work just fine in here. I attached you a sample code as well. I am wondering where was I missing.
Thank you.
Andi Santoso.
Attached is a simple sample i did.
After i selected record in WebCombo1 & WebCombo2, then i click the AutoPostBack button.
In Page_Load event, i'm not able to get WebCombo2.SelectedRow.Value.
Thank you for your detail informations. Now I know what is the issue in here. I have tried your scenarion and the code of yours is almost right. For our WebCombo, in order to get the selected row's value on back side, you can use, as this following code:
WebCombo2.Value
We do not need to use SelectedRow property again. I have tried it and it worked properly. I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.
Hi Andi,
I tested in the simple sample and it works. However in my project it doesn't work. I wonder it has to do with other component because i do have other component in my project which is WebTreeView.
Attached is the modified simple sample with WebTreeView. There's a "script" folder to create the table and insert data.
After i select record for WebCombo1 and WebCombo2, data will be populated in WebTreeView. When i check all the nodes in the WebTreeView and click the button, the system will insert data into database and PostBack. During PostBack, the WebCombo2.Value = "" but in fact there's selected record.
Thank you for your detail information. From what I see on your provided sample code, the value of WebCombo2 is not rendered because you put the data binding on page load. Would you kindly try to put the data binding not in the page load but in initialize data source. The value is null, perhaps, because after it do PostBack, it will do the data binding again. On intitialize data source, I suggest you to not use:
.DataSource = dsDepartment.Tables(0) .DataValueField = "DepartmentCode" .DataTextField = "DepartmentName" .DataBind()
Instead, I suggest you to use something like:
e.DataSource = dsDepartment.Tables(0) e.DataValueField = "DepartmentCode" e.DataTextField = "DepartmentName
When you bind the data in initialize data source, you do no need to put .DataBind() anymore.
I hope it helps and please let me know if it is solved. Thank you.
I put the data binding in initialize data source but the data seems like not bound?
Attached is the sample code.
Thanks!
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