asp.net¶¯Ì¬Éú³ÉTreeView
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;
using System.Data.SqlClient;
public partial class left : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GetTreeView();
}
private void GetTreeView()
{
try
{
string connectionstring = "Server=(local);uid=sa;pwd=123456;database=web";//Á¬½ÓSQLÊý¾Ý¿â
SqlConnection conn = new SqlConnection(connectionstring);
string sql = "select * from menu where menu_level=1 and parent_id =0";//²éѯһ¼¶½Úµã
SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
DataSet ds1 = new DataSet();
adapter.Fill(ds1, "temp");
DataTable table1 = ds1.Tables["temp"];//°Ñ¶ÁÈ¡µÄÊý¾Ý·ÅÈëDATATABLEÖÐ
TreeView1.Nodes.Clear();//½¨Á¢¸ù½Úµã£¬±éÀú¡£
foreach (DataRow dr1 in table1.Rows)
{
TreeNode root = new TreeNode();
&
Ïà¹ØÎĵµ£º
ÔÚweb·þÎñÆ÷¶Ë¿ª·¢Öо³£»áÓöµ½¸÷ÖÖ²»Í¬ÐÎʽµÄpath£¬¶øÇÒ¾³£¼Ç²»Çå³þÈçºÎ»ñÈ¡µ½Ä³ÖÖÌØ¶¨¸ñʽ£¬½ñÌì³éÁ˵ãʱ¼ä°Ñ³£ÓõÄpath»ñÈ¡·½·¨Óë¸ñʽ×öÁËÒ»¸ö¼òµ¥µÄ¶ÔÕÕ±í£¬ÒÔ±¸ÈÕºó²éÓá£
Request»ñÈ¡µÄÐÅÏ¢
Request.AppRelativeCurrentExecutionFilePath &nb ......
ASP.NET MVCºÍWebForm¸÷Óи÷µÄÓŵ㣬ÎÒÃÇ¿ÉÄÜÐèҪͬʱʹÓÃASP.NET MVCºÍWebForm¡£±¾ÎĽéÉÜÁËÈçºÎÔÚASP.NET MVCÏîÄ¿ÖÐʹÓÃWebForm¡£
Ê×ÏÈн¨Ò»¸öÃûΪWebFormsµÄÎļþ¼ÐÓÃÓÚ´æ·ÅWebForm£¬²¢Ìí¼ÓÒ»¸öWeb´°ÌåÎļþDemo.aspx×÷ΪÑÝʾ¡£
Demo.aspx¾Í¼òµ¥µÄÊä³öÒ»¾ä»°“It’s a WebForm.”
¹Ø¼ü²½ÖèÔÚÓÚ·ÓÉÉèÖá ......
ÔÚÓÃGridView¿Ø¼þʱ£¬ÎÒÃǾ³£»áÅöµ½»ñÈ¡µ±Ç°ÐеÄË÷Òý£¬Í¨¹ýË÷Òý½øÐÐÐí¶à²Ù×÷¡£ÀýÈ磬¿ÉÒÔ»ñµÃµ±Ç°ÐÐijһ¸ö¿Ø¼þÔªËØ£»ÉèÖÃÄ³Ò»ÔªËØµÄÖµµÈµÈ¡£
ÏÂÃæ½áºÏʵÀý½éÉܼ¸ÖÖ»ñµÃGridViewµ±Ç°ÐÐË÷ÒýÖµµÄ·½·¨¡£
ʵÀý£º
¢Ù Ä¿µÄ£º»ñÈ¡GridViewÖÐRowCommandµÄµ±Ç°Ë÷ÒýÐС£
¢Ú Ç°Ì¨Ò³Ãæ£ºÔÚGridViewÖÐÌí¼Óһģ°æÁУ¬ÀïÃæÌí¼ÓÒ»¸öLink ......
//²¿Êð×ÀÃæ¿ì½Ý·½Ê½*******************#region//²¿Êð×ÀÃæ¿ì½Ý·½Ê½*******************
StreamWriter sw2=System.IO.File.CreateText(Context.Parameters["des"].ToString()+"WebSetupTest.url");
stateSaver.Add("DeskQuick",Context.Parameters["des"].ToString() ......
˳±ãÌáÒ»ÏÂaspÖÐSessionµÄ¹¤×÷ÔÀí£º
aspµÄSessionÊǾßÓнø³ÌÒÀÀµÐԵġ£ASP Session״̬´æÓÚIISµÄ½ø³ÌÖУ¬Ò²¾ÍÊÇinetinfo.exeÕâ¸ö³ÌÐò¡£ËùÒÔµ±inetinfo.exe½ø³Ì±ÀÀ£Ê±£¬ÕâЩÐÅÏ¢Ò²¾Í¶ªÊ§¡£ÁíÍâ£¬ÖØÆð»òÕ߹رÕIIS·þÎñ¶¼»áÔì³ÉÐÅÏ¢µÄ¶ªÊ§¡£
asp.net SessionµÄʵÏÖ
asp.netµÄSessionÊÇ»ùÓÚHttpModule¼¼Êõ×öµÄ£¬HttpModule ......