You must Sign In to post a response.
  • Category: ASP.NET

    Error : Cannot have multiple items selected in a DropDownList.

    Are you looking for a way to resolve error Cannot have multiple items selected in a DropDownList ? then read this thread to know more about it

    Hello All
    I am adding jquery calender to textbox in , i come across "Cannot have multiple items selected in a DropDownList."
    it shows error in javascript code it self.. code is as follows

    $("#<%=txtSecondrevisiondate.ClientID %>").datepicker({
    dateFormat: "dd-mm-yy",
    showOn: 'button',
    buttonImageOnly: true,
    buttonImage: 'images/PickDate.gif'

    Also i have use
    ListItem lst = ddlstJournalName.Items.FindByValue(objTranDesk.MHJournalNameID.ToString());
    if (lst != null)
    lst.Selected = true;

    for selection of item from dropdown list.
  • #752241

    Can you please post the error details for giving some what better solution.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #752245
    What is the error coming in java script.

    The code does not reveal anu issue.

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #752255
    Before selection of any item in dropdown list you need to make selection clear.
    try with below snippet and check the result

    Before lst.Selected = true; line
    use below code

    hope it helps

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #752303
    Hello All
    i do all this you mention. the code is working fine while debugging code but when i remove debug point it throws error of Cannot have multiple items selected in a DropDownList.

    please help me out


  • Sign In to post your comments