TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
515
48k
Regarding binding Cascaded DropdownList
Aug 29 2018 8:29 PM
Hello,
I am using OrmLite technology in my MVC code. I need help to bind selected Cascaded DropdownLists (Country, State, City) for a logged in user which is saved on Signup Form.
Below is my code (this code binds only Country):
var countrystring = "SELECT Id, CountryName FROM CountryMaster where Id ='" + countryid + "'";
DataSet ds = new DataSet();
List<string> li = new List<string>();
DataTable dt = new DataTable();
dt = objdal.MyMethod(countrystring.ToString());
List<SelectListItem> list = new List<SelectListItem>();
foreach (DataRow row in dt.Rows)
{
list.Add(new SelectListItem { Text = Convert.ToString(row.ItemArray[1]), Value = Convert.ToString(row.ItemArray[0])});
}
ViewBag.country = list;
Here it binds Country based on CountryId, but another CountryNames is not getting bound.
Thanks in advance.
Reply
Answers (
3
)
Hiding a <td> depending on the Condition
Doubts about using IF and else