protected void Button1_Click(object sender, EventArgs e)
{
try
{
using (SPSite site = new SPSite("http://wingtip:49074"))
{
LabelShowTitle.Text = string.Empty;
LabelShowContents.Text = string.Empty;
LabelShowDatum.Text = string.Empty;
LabelAuthor.Text = string.Empty;
LabelLink.Text = string.Empty;
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists.TryGetList(DropDownListSelectCategory.SelectedItem.Value);
DateTime dt = DateTime.Now;
SPListItemCollection items = list.GetItems();
{
foreach (SPListItem news in items)
{
TextBoxContents2.Text = news["Contents"].ToString();
LabelShowTitle2.Text = news["Title"].ToString();
//LabelShowContents.Text = news["Contents"].ToString();
LabelShowDatum2.Text = news["Date"].ToString();
LabelAuthor2.Text = news["Authors"].ToString();
LabelLink2.Text = new SPFieldUrlValue(news["Links"].ToString()).Url;
TextBoxContents.Text = news["Contents"].ToString();
LabelShowTitle.Text = news["Title"].ToString();
//LabelShowContents.Text = news["Contents"].ToString();
LabelShowDatum.Text = news["Date"].ToString();
LabelAuthor.Text = news["Authors"].ToString();
LabelLink.Text = new SPFieldUrlValue(news["Links"].ToString()).Url;
}
site.Dispose();
}
}
My Problem is that i want it to display in the first news on news that i have created in my list as u see and in the other one display the other news "My other News"