TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sachin soni
NA
132
11.9k
Error: Data Not show in asp.net dropdown from sharepointList
Jun 12 2018 4:19 AM
I Write that code on page load of visual webpart
if (!Page.IsPostBack)
{
using (SPSite site = new SPSite("http://spserver:1500"))
{
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
SPList list = web.Lists["questionslist"];
ddlsecurity.DataSource = list.Items;
ddlsecurity.DataValueField = "Title"; // List field holding value - first column is called Title anyway!
ddlsecurity.DataTextField = "Title"; // List field holding name to be displayed on page
ddlsecurity.DataBind();
ddlsecurity.Items.Insert(0, new ListItem("--Select--", ""));
}
}
}
Reply
Answers (
4
)
How to call REST api in provider hosted app
SharePoint Online + Webjob