本页全部代码:
sing 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;
public partial class product : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (test_inj())
{ Response.Write("<script language=JavaScript>alert('链接不正确,请不要随便改动链接!!');window.location='index.aspx';</script>");
Response.Flush();
Response.End();
return;
}
string display_str = "";
if (Request.QueryString["id"] == "" | Request.QueryString["id"] == null)
{
Response.Write("<script language=JavaScript>alert('链接不正确,请不要随便改动链接!!');window.location='Default.aspx';</script>");
Response.Flush();
}
else
if (!isnumeric(Request.QueryString["id"]))
{
Response.Write("<script language=JavaScript>alert('链接不正确,请不要随便改动链接!!');window.location='Default.aspx';</script>");
Response.Flush();
}
WebSiteDataConfig.product Pr = this.dataSpace.GetObject<WebSiteDataConfig.product>("productId=" + Request.QueryString["id"]);
if (Pr == null)
{
Response.Write("<script language=JavaScript>alert('链接不正确,数据库中没有此产品!!');window.location='Default.aspx';</script>");
Response.Flush();
}
int classid = Convert.ToInt16(Pr.product_class);
string[] ls = childsPclass(classid).Split(new char[] { '*' });
int Tcid = System.Convert.ToInt16(ls[1]);
int Pcid;
if (ls.Length > 2)
Pcid = System.Convert.ToInt16(ls[ls.Length - 2]);
else
Pcid = Tcid;
WebSiteDataConfig.webInfo webconfig = this.dataSpace.GetObject<WebSiteDataConfig.webInfo>("webInfoId=1");
//写页开始及head
display_str += writepagehead("css/css.css", webconfig.webname + " " + webconfig.webkeywords, "\\css\\menu.js");
//写body
display_str += writeBodyMenu() + "<table width=100% border=0 cellpadding=0 cellspacing=0>";
//写头部
display_str += "<tr><td background=images/t04.jpg>";
display_str += "<table width=733 border=0 align=center cellpadding=0 cellspacing=0>";
display_str += "<tr><td height=130>" + writeadvert(2, 1, 0, 0, "") + "</td></tr>";//flash标
display_str += readfile("\\inc\\mainmenu.html");
//
display_str += "<tr><td>" + writeMainMenu() + "</td></tr>";
//
display_str += "<tr><td>" + writeSearchandLogin() + "</td></tr>";
display_str += "</table></td></tr><tr><td height=15></td></tr>\n";
//头部完成
Response.Write(display_str);
Response.Flush();//输出
display_str = "<tr><td><table width=733 border=0 align=center cellpadding=0 cellspacing=0><tr><td width=170 valign=top>";
//写产品类菜单
display_str += writeMenu(Tcid, 2, classid, 0,"class");
Response.Write(display_str);
Response.Flush();//输出
display_str = "</td><td width=17><img src=images/t03.gif width=17 height=1 border=0></td><td width=546 valign=top><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td>";
display_str += "<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr><td height=50 colspan=3 align=left valign=middle class=p3t1E> " + readPclassname(System.Convert.ToInt16(Pr.product_brand)) + "</td></tr><tr><td height=35 colspan=3 align=left valign=top class=p3t2> " + Pr.product_name + "</td></tr><tr><td height=18 colspan=3><img src=images/t24.jpg width=545 height=18></td></tr><tr><td height=15 colspan=3> </td></tr><tr><td width=405 height=200><img src='";
if (Pr.product_pic == "" | Pr.product_pic == null)
display_str += "images/nopic.gif";
else
display_str += Pr.product_pic;
display_str += "' width=200 height=200><a href="+Pr.product_pic.Replace (".jpg","a.jpg")+"><img
src='"+Pr.product_pic+"'
style='width:200; height:200;border-style :none '/></a></td><td width=15> </td><td width=384 align=left valign=middle><span class=xxx>价格:</span><span class=xxxE>";
if (Pr.product_price.ToString("C") == "¥0.00")
display_str += "议价";
else
display_str += Pr.product_price.ToString("C");
display_str+="</span><br /><br />";
if (Session["userid"] == null )
display_str += "<span class=xx>加入您的订单?</span><br /><br /><span class=x>请您先登录会员帐户完成此操作<br />或点击这里成为新会员</span>";
else
display_str += "<a href=cart.aspx?id="+Pr.productId.ToString()+"&act=add><span class=xx>加入您的订单?</span></a><br /><br />";
display_str+="</td></tr><tr><td height=30 colspan=3> </td></tr><tr><td colspan=3>";
if (Pr.product_detail == "" | Pr.product_detail == null)
display_str += "暂无详细介绍!!";
else
display_str += Pr.product_detail;
display_str += "</td></tr></table>";
display_str += "</td></tr></table></td></tr></table></td></tr><tr><td height=30></td></tr>";
//写底部
display_str += "<tr><td>" + writeCopyRight(webconfig) + "</td></tr>";
display_str += "</table></body></html>";
Response.Write(display_str);
Response.Flush();//输出
}
}