1.繼續(xù)完成 顯示列表 搜索顯示功能碌上。上周只完成了分頁和數(shù)據(jù)提取,今天完成搜索功能矛纹。(中午11點完成)
2.設(shè)計經(jīng)驗詳細頁 (HTML+CSS)
3.列表單行 添加 tooltips 克握,引導進入經(jīng)驗詳細頁面。
==================================
asp.net MVC 頁面引入的js文件二驰,如何防止緩存?
由于JS文件改動頻繁秉沼,每次都要手動更改后綴才能防止被緩存。
<script src="~/Scripts/Home/projectExperience.js?v=@DateTime.Now.Millisecond.ToString()" type="text/javascript"></script>
為URL添加一個后綴矿酵,就解決緩存問題唬复。(本來想過用js生成一個隨機數(shù),但是需要把引入js代碼寫成 document.write("")全肮。不爽敞咧。只能考慮C#的方法了。)
==================================
截至到11:10 終于做完了分頁查詢功能辜腺。 報錯多多休建。
URL傳值需要做編碼/解碼
JS文件:
var startD = $('#inputStartTime').val().replace(/-/g, "");
var endD = $('#inputEndTime').val().replace(/-/g, "");
console.log(startD + "|" + endD);
//日期驗證乍恐,結(jié)束日期不能比開始日期早。
if (parseInt(endD) - parseInt(startD) < 0)
{
alert("結(jié)束日期不能比開始日期早");
return;
}
var str_search = "page="+page;
str_search += "&startDate=" + startD;
str_search += "&endDate=" + endD;
str_search += "&keywords=" + encodeURI($('#exper_keywords').val());
str_search += "&expno=" + encodeURI($('#exper_no').val());
str_search += "&bigkings=" + encodeURI($('#exper_bigkinds').val());
str_search += "&smallkings=" + encodeURI($('#exper_smallkinds').val());
str_search += "&expertype=" + encodeURI($('#exper_type').val());
c#文件:
keywords = HttpUtility.UrlDecode(keywords);
expno = HttpUtility.UrlDecode(expno);
bigkings = HttpUtility.UrlDecode(bigkings);
smallkings = HttpUtility.UrlDecode(smallkings);
expertype = HttpUtility.UrlDecode(expertype);
SQL語句忘記打單引號
if (!string.IsNullOrEmpty(keywords))
{
columnList.Add(new Tuple<string, object>("keywords", keywords));
strWhere = strWhere + string.Format(" and t1.QUESTION LIKE '%{0}%' ", columnList[columnList.Count() - 1].Item2);
}
if (!string.IsNullOrEmpty(expno))
{
columnList.Add(new Tuple<string, object>("expno", expno));
strWhere = strWhere + string.Format(" and t1.GUID ='{0}'", columnList[columnList.Count() - 1].Item2);
}
if (!string.IsNullOrEmpty(bigkings))
{
columnList.Add(new Tuple<string, object>("bigkings", bigkings));
strWhere = strWhere + string.Format(" and t1.PTYPE = '{0}' ", columnList[columnList.Count() - 1].Item2);
}
if (!string.IsNullOrEmpty(smallkings))
{
columnList.Add(new Tuple<string, object>("smallkings", smallkings));
strWhere = strWhere + string.Format(" and t1.STYPE = '{0}' ", columnList[columnList.Count() - 1].Item2);
}
if (!string.IsNullOrEmpty(expertype))
{
columnList.Add(new Tuple<string, object>("expertype", expertype));
strWhere = strWhere + string.Format(" and t1.FAQTYPE = '{0}' ", columnList[columnList.Count() - 1].Item2);
}
以上全部沒打测砂。茵烈。。后來才打上砌些。
組元數(shù)據(jù)類型呜投,item不是從0開始,而是從1開始存璃。
columnList.Add(new Tuple<string, object>("keywords", keywords));
strWhere = strWhere + string.Format(" and t1.QUESTION LIKE '%{0}%' ", columnList[columnList.Count() - 1].Item2);
如果寫成columnList[columnList.Count() - 1].Item1仑荐,則只會取到“keywords”