-
Notifications
You must be signed in to change notification settings - Fork 2
/
NewsDetail.aspx.cs
executable file
·36 lines (35 loc) · 1 KB
/
NewsDetail.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Linq;
using System.Data.SqlClient;
// 下载于www.51aspx.com
public partial class NewsDetail : System.Web.UI.Page
{
public string newsContent = "";
protected void Page_Load(object sender, EventArgs e)
{
SqlData da = new SqlData();
string sqlString = "select * from tb_News";
DataSet ds = da.datesetExecute(sqlString, "tbNews");
DataRow[] row=ds.Tables["tbNews"].Select("id="+Request.QueryString["id"]);
foreach (DataRow rs in row)
{
this.labTitle.Text = rs["title"].ToString();
newsContent = rs["content"].ToString();
}
}
public string GetContent()
{
string str = "";
str = newsContent;
return str;
}
}