To get the value of the usemap attribute of an image, use the useMap property. You can try to run the following code to display the usemap attribute value −Example var x = document.getElementById("myid").useMap; document.write("Usemap: "+x);
In Dynamic binding, the compiler will not do type checking at compile time. At run time, the checking is done.Use it to avoid the restriction of anonymous types to one method. This is only because the type name is visible only to the compiler; therefore, you cannot declare it as the return value of a method.Examplepublic dynamic GetAnonymousType() { return new { StudentName = "Tom", Subject = "Java", }; }Above, the method is set to be dynamic, that would means the compiler won’t do type checking at compile time.public dynamic GetAnonymousType() { }
To change the width of a table border, use the DOM border property. You can try to run the following code to change the width of a table border in JavaScript −Example function borderFunc(x) { document.getElementById(x).style.border = "5px dashed blue"; } One Two Three Four Five Six
Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed. If an activity is blocked like this in a synchronous process, then the complete application waits and it takes more time. The application stops responding. Using asynchronous approach, the applications continues with other tasks as well.An application with a GUI, check the content of the queue and if an unprocessed task is there, it takes it out and processes it first. The code executes synchronously and the unprocessed task is completed first. The application will show stop responding messages if the processing takes more time ... Read More
Get the keys in the SortedList using the keys property of SortedList class in C#. We have first set the SortedList property with elements.SortedList sl = new SortedList(); sl.Add("ST0", "One"); sl.Add("ST1", "Two"); sl.Add("ST2", "Three"); sl.Add("ST3", "Four"); sl.Add("ST4", "Five"); sl.Add("ST5", "Six"); sl.Add("ST6", "Seven");Now use the keys property to get the keys.ICollection key = sl.Keys;The following is the complete code to implement keys property of SortedList class.Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList sl = new SortedList(); sl.Add("ST0", "One"); ... Read More
Use the IsFixedSize property in C# to get a value indicating whether the SortedList has a fixed size.The following is an example showing SorteList with the usage of IsFixedSize property.Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList s = new SortedList(); s.Add("S1", "Maths"); s.Add("S2", "Science"); s.Add("S3", "English"); s.Add("S4", "Economics"); Console.WriteLine("IsFixedSize = " + s.IsFixedSize); } } }OutputIsFixedSize = FalseWe ... Read More
Use the IsReadOnly property to get a value indicating whether the SortedList is read-only or not.You can try to run the following code to implement IsReadOnly property in C#.Here, we have set the SortedList first.SortedList s = new SortedList();Added elements.s.Add("S001", "Jack"); s.Add("S002", "Henry");Now check for IsReadOnly.Console.WriteLine("IsReadOnly = " + s.IsReadOnly);The following is the complete code.Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList s = new SortedList(); s.Add("S001", "Jack"); s.Add("S002", "Henry"); Console.WriteLine("IsReadOnly ... Read More
Character constantsCharacter literals are enclosed in single quotes. For example, 'x' and can be stored in a simple variable of char type. A character literal can be a plain character (such as 'x'), an escape sequence (such as '\t'), or a universal character (such as '\u02C0').Certain characters in C# are preceded by a backslash. They have special meaning and they are used to represent like newline () or tab (\t).Example Live Demousing System; namespace Demo { class MyApplication { static void Main(string[] args) { Console.WriteLine("Welcome\t to the website"); Console.ReadLine(); ... Read More
Use the File.exists method in C# to check if a file exits in C# or not.Firstly, check whether the file is present in the current directory.if (File.Exists("MyFile.txt")) { Console.WriteLine("The file exists."); }After that check whether the file exist in a directory or not.if (File.Exists(@"D:\myfile.txt")) { Console.WriteLine("The file exists."); }Let us see the complete example to check if a file exists in C#.Example Live Demousing System; using System.IO; class Demo { static void Main() { if (File.Exists("MyFile.txt")) { Console.WriteLine("File exists..."); } else { Console.WriteLine("File does ... Read More
Use the isFixedSize property of Hashtable class to get a value indicating whether the Hashtable has a fixed size.The following is an example showing how to work with IsFixedSize property.Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { Hashtable ht = new Hashtable(); ht.Add("D01", "Finance"); ht.Add("D02", "HR"); ht.Add("D03", "Operations"); Console.WriteLine("IsFixedSize = " + ht.IsFixedSize); Console.ReadKey(); } } }OutputIsFixedSize = FalseAbove we ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP