?? search.aspx.cs
字號:
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;
public partial class Search : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//read in the category name from the head
if (Request.QueryString["q"] != null) {
lblTitle.Text = "搜索 '" + Request.QueryString["q"].ToString()+"'";
}
}
protected string GetThumb(object sImage) {
string imageName = sImage.ToString();
string sType = System.IO.Path.GetExtension(imageName);
string sThumb = sType.Replace(".", "_thumb.");
imageName = imageName.Replace(sType, sThumb);
return imageName;
}
protected string GetPrice(object sUnitCost,object sDiscountPercent) {
string sPrice = sUnitCost.ToString();
string sDiscount = sDiscountPercent.ToString();
double dOriginalPrice=Convert.ToDouble(sPrice);
double dDiscountPrice = 0;
string sOut = "";
int discountPercent = int.Parse(sDiscount);
if (discountPercent > 0) {
dDiscountPrice = CatalogManager.GetDiscountedPrice(dOriginalPrice, discountPercent);
sOut = "<span class=oldprice>" + dOriginalPrice.ToString("c") + "</span> <span class=saleprice>" + dDiscountPrice.ToString("c") + "</span>";
} else {
sOut = dOriginalPrice.ToString("c");
}
return sOut;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -