how to bind data in dropdownlist without using datasource in asp.net

string strEmployee = "Sample-123";
                        string[] strarr = strEmployee.Split('-');
                        ((DropDownList)e.Row.FindControl("ddlEmployee")).Items.Insert(0, new ListItem(strEmployee,strarr[0]));
                  Text            Value

Comments

Popular posts from this blog

Mail Sending in asp.net c#

CRUD Operation Entity Framework using asp.net MVC

How to Bind Drodown data in MVC Cshtml page in c#