Showing posts with label Default. Show all posts
Showing posts with label Default. Show all posts

22 July 2021

Default parameters in javascript

function print(a = 100) {
console.log(a);
}
print();
print(200);

Output:

100

200            

Github link : https://github.com/adi501/JavaScriptExamples.git






27 February 2014

Add Default Item In DropDownList

              I have a dropdown list that takes it's values (country name) from a database. But what I would like to be able to do is to set the first item in the dropdown list manully.
· Add DropDownList in your .aspx page
<asp:dropdownlist id="DropDownList1" runat="server">
<asp:listitem value="Select Country">---Select Country---</asp:ListItem>
</asp:DropDownList>
· Now set the AppendDataBoundItems Property of dropdownlist to true
<asp:dropdownlist id="DropDownList1" runat="server" appenddatabounditems="True">
<asp:listitem value="Select Country">---Select Country--</asp:ListItem>
</asp:DropDownList>