Skip to content
Loading
  • Nanddeep Nachan
    0
    Please refer below article:
    https://www.c-sharpcorner.com/UploadFile/746cd9/bind-dropdownlist-in-sharepoint-using-C-Sharp/ 
    0
  • Reshma Bhalekar
    0
    Hi Sachin,
     
    Try below code
     
     
     
    protected void Page_Load(object sender, EventArgs e) {
    try {
    using(SPSite site = new SPSite("Server url")) {
    using(SPWeb web = site.OpenWeb()) {
    if (!Page.IsPostBack) {
    BindData(web);
    }
    }
    }
    } catch (Exception) {}
    }
    public void BindData(SPWeb oweb) {
    SPList list = oweb.Lists["lstName"];
    ddlv.DataSource = list.Items;
    ddlv.DataValueField = "Title";
    ddlv.DataTextField = "Title";
    ddlv.DataBind();
    }
     
    I tried it and it is working properly. 
    0
  • Reshma Bhalekar
    0
    What error you are getting? Can you please post it.
    0