Binding an asp.net dropdownlist with an XML file - Part 18

  Рет қаралды 177,081

kudvenkat

kudvenkat

Күн бұрын

Пікірлер: 21
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 11 жыл бұрын
Hi, this is a very good question. It works here because, we are adding a ListItem to the items collection of the dropdownlist. This is not going to affect the data in any way, that is associated with the dropdownlist thru the use of datasource property. Please let me know, if this clarifies your question. Good Luck.
@bebek8989
@bebek8989 9 жыл бұрын
greatt. perfercto explanation. i follow the instruction n zero bug. thank you venkat
@crudhost
@crudhost 8 жыл бұрын
Today, dataset is only to read/write very small subset of XML. LinQ to XML have no such restriction: var path = Server.MapPath("Countries.xml"); ListItem li = new ListItem("Select", "-1"); try { XElement data = XElement.Load(path); var countriesXML = from c in data.Elements("Country") select new ListItem { Value = c.Element("CountryID").Value, Text = c.Element("CountryName").Value }; foreach (var country in countriesXML) { this.CountryXMLDDL.Items.Add(country); } this.CountryXMLDDL.Items.Insert(0, li); } catch (Exception) { //You need to find the possible Exception throw; }
@875_rishabhprajapati7
@875_rishabhprajapati7 2 жыл бұрын
Awesome video
@shiningyrlife
@shiningyrlife 9 жыл бұрын
You saved me!
@RoiTrigerman
@RoiTrigerman 11 жыл бұрын
Hi and thank you for another great video. I have just one question: how come when you added the "Select" item to the list, after the DataBind, it still added the item to the list, whereas in a previous video you said that there is no way to change the DropdownList after the DataBind method was executed? thanks.
@amitsingh-hu9hz
@amitsingh-hu9hz 10 жыл бұрын
i have put a button under the list. Why isn't the 'select' item added to the list once more, each time i click the button like u show in tutorial 16. Although i haven't used (!IsPostBack).
@dgloria
@dgloria 9 жыл бұрын
Excellent videos. Better to disable that select item ;)
@sapnarawal1226
@sapnarawal1226 6 жыл бұрын
Hello Sir, I have a question...Is all these videos in ASP.Net playlist are outdated or still i can follow them. As i can see you have uploaded it almost ^6 years back. Please reply. Regards , Sapna Rawal
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 6 жыл бұрын
Hello Sapna - Though ASP .NET is 6 years old technology, it still has it's use cases. Many organisations are still using ASP .NET web forms for their web application needs. If you know you will be working on applications built using web forms, I suggest learn ASP .NET and this playlist is still relevant for that. Hope this answers your question.
@sapnarawal1226
@sapnarawal1226 6 жыл бұрын
kudvenkat Thanks for ur reply Sir.🙏🏻
@Danial3725
@Danial3725 4 жыл бұрын
Hello, thanks for this tutorial I am facing an issue displaying the dropdown list. I tried the code you provide but still can't display it I would appreciate it if you could help me Thank you
@shoaibmitha
@shoaibmitha 10 жыл бұрын
Hi, I typed the code exactly as you displayed it in the video, but I get the following errors: An exception of type 'System.Web.HttpException' occurred in System.Web.dll but was not handled in user code Additional information: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'CountryName'. Could you help me with what I am doing wrong, Thanks.
@shoaibmitha
@shoaibmitha 10 жыл бұрын
Ok, never mind I figured out what I was doing wrong. It was the XML file: 101 India 102 USA 103 Australia 104 UK I had everything enclosed in the one tag... Thanks for the videos. There are a great help.
@MrHooglaz
@MrHooglaz 12 жыл бұрын
How, then, would I seet the clear button? Can't seem to find something that works. i want it to return to "select". thanks
@MrHooglaz
@MrHooglaz 12 жыл бұрын
nevermind. i went back to original ddl.SelectedIndex = -1; and all is well. Geez, i swear i tried that once and it didn't work. the joys of coding. thanks for another great vid.
@sebastube123
@sebastube123 4 жыл бұрын
What is the difference if I use Server.MathPath("..."); or if I just use the "~"?. As far I remeber "~" returns the relative path to the application.
@anuragmalik3636
@anuragmalik3636 9 жыл бұрын
awesome
@tbotee
@tbotee 11 жыл бұрын
Roi Trigerman : You cannot change the source DataTextField and DataValueField after Binding, but you can add elements to the DropDownList
@ravirajpatil3014
@ravirajpatil3014 11 жыл бұрын
sir how should i choose AdoDemo.WebForm1
@amolchanne1871
@amolchanne1871 5 жыл бұрын
How to bind asp.net calendar with Xml file
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
Dropdownlist in asp.net   Part 16
12:48
kudvenkat
Рет қаралды 300 М.
The Basics of Data Binding in WPF
20:53
Tactic Devs
Рет қаралды 50 М.
Uploading Files to Blazor - The Blazor File Upload Mini Course
43:11
Asp.net calendar control properties and events   Part 33
17:48
kudvenkat
Рет қаралды 114 М.
Intro to the CsvHelper Library for C#
27:12
IAmTimCorey
Рет қаралды 29 М.
XML & ElementTree  ||  Python Tutorial  ||  Learn Python Programming
10:30
IIS Internet Information Services and ASP.NET   Part 9
14:26
kudvenkat
Рет қаралды 441 М.
Create XML File in C#
13:24
Code Doge
Рет қаралды 17 М.