baglanti.Open();
if (Request.QueryString["id"] != null)
{
int sayi = Int16.Parse(Request.QueryString["id"].ToString());
OleDbDataAdapter adaptor = new OleDbDataAdapter("select * from sayfa where Kimlik=" + sayi, baglanti);
DataTable tablo = new DataTable();
adaptor.Fill(tablo);
Baslik.Text = tablo.Rows[0]["baslik"].ToString();
Icerik.Text = tablo.Rows[0]["icerik"].ToString();
}
else
{
Response.Redirect("/bulunamadi");
}
baglanti.Close();


Daha sonra Global.asax içerisinde şunu yapman gerekecek


void Application_BeginRequest(object sender, EventArgs e)
{
string strURL = Context.Request.Url.AbsoluteUri;
strURL = strURL.ToLower();

string[] arrParcalar = strURL.Split('/');
string strAna_Parca = arrParcalar[3];
if (arrParcalar.Length == 4)
{
//http://localhost:61479/bulunamadi
string strParca = arrParcalar[3];
if (strParca .IndexOf("bulunamadi") > -1)
{
Context.RewritePath("~/404.aspx");
}
}
}