仿google拖拽, aspx实现

asp.net+javascript+css(模仿google的拖拽的个性网页布局)(操作数据库篇2)

该效果在firefox和IE中测试通过.拖动然后就布局自动保存到数据库里了.

SaveSide.aspx.cs

public class SaveSide : System.Web.UI.Page
{
ahui4367.SideSql tempSideSql=new SideSql();
private void Page_Load(object sender, System.EventArgs e)
{
if(Request.QueryString["action"]=="changeSide")
{
string strLeft=Request.QueryString["strleft"];
string strCenter=Request.QueryString["strCenter"];
string strRight=Request.QueryString["strRight"];
tempSideSql.SaveSide(strLeft,strCenter,strRight,1);
}
}

#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}

我把昨天的发表的代码又修改了.具体的看下面的/还使用了prototype1.4的框架了,

<% @Pagelanguage = " c# " Codebehind = " WebForm6.aspx.cs " AutoEventWireup = " false " Inherits = " demoClass.WebForm6 " %>
<! DOCTYPEHTMLPUBLIC " -//W3C//DTDHTML4.0Transitional//EN " >
< HTML >
< HEAD >
< title > WebForm6 </ title >
< metacontent = " MicrosoftVisualStudio.NET7.1 " name = " GENERATOR " >
< metacontent = " C# " name = " CODE_LANGUAGE " >
< metacontent = " JavaScript " name = " vs_defaultClientScript " >
< metacontent = " http://schemas.microsoft.com/intellisense/ie5 " name = " vs_targetSchema " >
< scriptsrc = ' prototype-1.4.0.js ' ></ script >
< scriptsrc = " google_drag.js " ></ script >

< style >
.modbox.el
... {}
.modbox.csl
... {DISPLAY:none}
.modbox.es
... {DISPLAY:none}
.modbox_e.el
... {DISPLAY:none}
.modbox_e.csl
... {}
.modbox.es
... {}
.fres
... {OVERFLOW:hidden;;WIDTH:expression(_gel("ffresults").offsetWidth+"px")}
.panelo
... {}
.panelc
... {}
.mod
... {}
.unmod
... {}
FORM
... {DISPLAY:inline}
.c
... {CLEAR:both}
BODY
... {FONT-FAMILY:arial,sans-serif}
TD
... {FONT-FAMILY:arial,sans-serif}
A
... {FONT-FAMILY:arial,sans-serif}
P
... {FONT-FAMILY:arial,sans-serif}
.h
... {FONT-FAMILY:arial,sans-serif}
A:link
... {COLOR:#0000cc}
A:visited
... {COLOR:#551a8b}
A:active
... {COLOR:#ff0000}
.mttl
... {PADDING-RIGHT:5px;PADDING-LEFT:2px;FONT-WEIGHT:bold;FONT-SIZE:122%;WIDTH:90%;BACKGROUND-COLOR:#e5ecf9}
H2.modtitle
... {FONT-WEIGHT:normal;FONT-SIZE:100%;PADDING-BOTTOM:0px;MARGIN:0em;WIDTH:100%;PADDING-TOP:0px}
.modbox
... {MARGIN-BOTTOM:20px;BACKGROUND-COLOR:white}
.modbox_e
... {MARGIN-BOTTOM:20px;BACKGROUND-COLOR:white}
#c_1
... {VERTICAL-ALIGN:top;WIDTH:32%}
#c_2
... {VERTICAL-ALIGN:top;WIDTH:32%}
#c_3
... {VERTICAL-ALIGN:top;WIDTH:32%}
.mhdr
... {PADDING-RIGHT:0px;BORDER-TOP:#3366cc1pxsolid;PADDING-LEFT:0px;FONT-SIZE:82%;PADDING-BOTTOM:0px;MARGIN:0px;WIDTH:100%;PADDING-TOP:0px}
.medit
... {PADDING-RIGHT:2px;VERTICAL-ALIGN:top;WIDTH:10%;WHITE-SPACE:nowrap;BACKGROUND-COLOR:#e5ecf9;TEXT-ALIGN:right}
.medit
... {COLOR:#77c}
.meditA:visited
... {COLOR:#77c}
.meditA:link
... {COLOR:#77c}
.meditA:active
... {COLOR:#77c}
.mc
... {FONT-SIZE:82%;PADDING-BOTTOM:4px;WIDTH:100%;PADDING-TOP:4px}
</ style >
</ HEAD >
< bodyMS_POSITIONING = " GridLayout " >
< formid = " Form1 " method = " post " runat = " server " >
< tablecellpadding = " 0 " cellspacing = " 0 " border = " 0 " width = " 100% " >
< tr >
< tdvalign = " top " width = " 100% " >
< divid = " modules " >
< tableid = " t_1 " cellspacing = " 10 " border = " 0 " width = " 98% " align = " center " style = " TABLE-LAYOUT:fixed " >
< tr >
< tdid = " c_1 " >
< asp:Literalid = " sideLeft " runat = " server " ></ asp:Literal >
</ td >
< tdid = " c_2 " >
< asp:Literalid = " sideCenter " runat = " server " ></ asp:Literal >
</ td >
< tdid = " c_3 " >
< asp:Literalid = " sideRight " runat = " server " ></ asp:Literal >
</ td >
</ tr >
</ table >
</ div >
</ td >
</ tr >
</ table >
< DIV ></ DIV >
</ TD ></ TR ></ TABLE >
</ form >
< script >

functionaddEvent(obj,evenTypeName,fn)
... {
if(obj.addEventListener)...{
obj.addEventListener(evenTypeName,fn,
true);
returntrue;
}
elseif(obj.attachEvent)...{
returnobj.attachEvent("on"+evenTypeName,fn);
}
else...{
returnfalse;
}

}


_table
= document.getElementById( " t_1 " );

addEvent(window,
" load " ,_IG_initDrag(_table));


</ script >
</ body >
</ HTML >
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using ahui4367;
namespace demoClass
... {
/**////<summary>
///WebForm6的摘要说明。
///</summary>

publicclassWebForm6:System.Web.UI.Page
...{
protectedSystem.Web.UI.WebControls.LiteralsideLeft;
protectedSystem.Web.UI.WebControls.LiteralsideCenter;
protectedSystem.Web.UI.WebControls.LiteralsideRight;
SideTempSide
=newSide();
SideSqlTempSideSql
=newSideSql();
WinInfoTempWinInfo
=newWinInfo();
WinInfoSqlTempWinInfoSql
=newWinInfoSql();
char[]dot=...{','};

privatevoidPage_Load(objectsender,System.EventArgse)
...{

分享到:
评论
wapysun
  • 浏览: 4867731 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

你可能感兴趣的:(UI,Web,Google,asp.net,asp)