asp.net ¶à×Ö¶ÎÄ£ºý²éѯ´úÂë
¾³£Óõ½¶à×ֶεÄÄ£ºý²éѯ£¬ÉÏÃæµÄº¯Êý¿ÉÒÔʵÏÖ£¬ÀýÈçstrKeyWordsֵΪ“½Å±¾Ö®¼Ò”ʱ
string strField = "id|className|classAdd";
string strKeyWords = this.tbxKeyWords.Text.Trim();
string strSql = dbexe.searchText("select * from class", strField, strKeyWords);
¾³£Óõ½¶à×ֶεÄÄ£ºý²éѯ£¬ÉÏÃæµÄº¯Êý¿ÉÒÔʵÏÖ£¬ÀýÈçstrKeyWordsֵΪ“½Å±¾Ö®¼Ò”ʱ£¬¿ÉÒÔÊä³ö£º
select * from class where id like '%½Å±¾Ö®¼Ò%' or className like '%½Å±¾Ö®¼Ò%' or classAdd like '%½Å±¾Ö®¼Ò%'
º¯Êý£º
/// <summary>
/// ¸ù¾Ý¹Ø¼ü×ÖʵÏÖ¶à×Ö¶ÎÄ£ºý²éѯ
/// </summary>
/// <param name="sqlStr">select * from talbe sqlÓï¾ä</param>
/// <param name="sqlText">ÅжÏÓï¾äÌõ¼þ£¬ÊÇÒ»¸öÓÃ|¸ô¿ªµÄ×Ö·û´®</param>
/// <param name="keywords">¹Ø¼ü×Ö</param>
public static string searchText(string strSql, string strField, string keywords)
{
StringBuilder sb = new StringBuilder(strSql);
if (strField != string.Empty)
{
sb.Append(" where ");
string[] arrKey = strField.Split('|');
for (int i = 0; i < arrKey.Length; i++)
{
sb.Append(arrKey[i] + " like '%" + keywords + "%' or ");
}
string str = sb.ToString();
//È¥³ý×îºóÒ»¸ö"or"
if (str.IndexOf("or") >= 0)
{
return str.Remove(str.LastIndexOf("or"));
}
return str;
}
return strSql;
}
Ïêϸ³ö´¦²Î¿¼£ºhttp://www.jb51.net/article/15251.htm
Ïà¹ØÎĵµ£º
ÔÚºǫ́ÓÃC#ö¾Ù¿Ø¼þ²»ÏñjavascriptÄÇô¼òµ¥£¬HasControlsÖ»ÄÜ×¥µ½Ö±Êôϼ¶µÄ¿Ø¼þ£¬Èç¹ûÓжà¸ödiv£¬tableǶÌ×£¬¾ÍÒªµÝ¹éÁË
public static void CloseAllContent(System.Web.UI.Control page,bool bOpen)
{
int nPageControls = page.Controls.Count ......
ASP.NET FCKeditor Îı¾±à¼Æ÷µÄʹÓà ¡¾×ª¡¿
ÏÂÔصØÖ·£ºhttp://www.fckeditor.net/download
FCKeditorʹÓÃ
Ò»¡¢ÅäÖÃ
1¡¢ÔÚwww.fckeditor.net
µã»÷Download£¬ÏÂÔØFCKEditor_2.5.1.zipºÍFCKEditor.Net(ASP.NET
Control to easily integrate FCKEditor on .Net Web pages.)
2¡¢Ð½¨Ò»ÏîÄ¿£¬±ÈÈç½ÐFCK¡£½âѹFCKEd ......
Asp.netÍøÕ¾·¢²¼µ½IISÉÏ£¬²Ù×÷ÎļþµÄʱºò·¢Éú‘System.UnauthorizedAccessException:¶Ô·¾¶“***”µÄ·ÃÎʱ»¾Ü¾ø’¡£
˵Ã÷ûÓÐÊÚÓèAsp.net¶ÔÎļþµÄд·ÃÎÊȨ£¬ÍøÉÏÕÒÁËÒ»ÏÂ:
ÈôÒªÊÚÓè ASP.NET ¶ÔÎļþµÄд·ÃÎÊȨ£¬ÇëÔÚ×ÊÔ´¹ÜÀíÆ÷ÖÐÓÒ»÷¸ÃÎļþ£¬Ñ¡Ôñ“ÊôÐÔ”£¬È»ºóÑ¡Ôñ“°²È«”Ñ¡Ïî¿ ......
using System;
using System.Data;
using System.Configuration;
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 Microsoft.Office.Inter ......
1. Get(¼´Ê¹ÓÃQueryStringÏÔʽ´«µÝ)
·½Ê½£ºÔÚurlºóÃæ¸ú²ÎÊý¡£
Ìص㣺¼òµ¥¡¢·½±ã¡£
ȱµã£º×Ö·û´®³¤¶È×Ϊ255¸ö×Ö·û£»Êý¾Ýй©ÔÚurlÖС£
ÊÊÓÃÊý¾Ý£º¼òµ¥¡¢ÉÙÁ¿¡¢¹Ø¼üµÄÊý¾Ý¡£
ÊÊÓ÷¶Î ......