--我先介绍下这个咚咚有点像CommunityServer首页上修改新闻的功能哈哈
- -我看了CommunityServer口水流啊流终于有此修改^^绝对是自己搞得TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔

TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
单击


TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
弹出
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
修改完毕


简单的逻辑过程-结合下面的aspx说说页面上的简单逻辑哈哈:

当你单击名称为-Title的div时-ModalPopupExtender就弹出让你修改标题,当你点关闭的时候(首先当然ModalPopupExtender只是隐藏了)
会调用名称为"OnCallBack('SetTitle')"的脚本,- -被你识破了吧这个是客户端回调,然后经过正常的
TheBeerHouse流程保存到数据源中,- -ok我们一点一点地来

TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TitleTest.aspx.cs" Inherits="Test_TitleTest" %>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔      
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔      
<%@ Register
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
Assembly="AjaxControlToolkit"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    Namespace
="AjaxControlToolkit"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    TagPrefix
="ajaxToolkit" %>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
<%@ Register
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
Assembly="AjaxControlToolkit"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    Namespace
="AjaxControlToolkit"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    TagPrefix
="ajaxToolkit" %>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
<html xmlns="http://www.w3.org/1999/xhtml" >
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
<head runat="server">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
<title>无标题页</title>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
<style>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔/**//*Modal Popup*/
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.modalBackground {}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:Gray;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    filter:alpha(opacity=70);
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    opacity:0.7;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.modalPopup {}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:#ffffdd;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    border-width:3px;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    border-style:solid;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    border-color:Gray;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    padding:3px;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    width:250px;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.sampleStyleA {}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:#FFF;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.sampleStyleB {}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:#FFF;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-family:monospace;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-size:10pt;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-weight:bold;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.sampleStyleC {}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:#ddffdd;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-family:sans-serif;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-size:10pt;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-style:italic;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.sampleStyleD {}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:Blue;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    color:White;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-family:Arial;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    font-size:10pt;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔/**//*Popup Control*/
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.popupControl{}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:White;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    position:absolute;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    visibility:hidden;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.validatorCalloutHighlight 
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔{}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color: lemonchiffon; 
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔/**//*当点击修改标题区域的时候更换的背景*/
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.selectTitle{}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:Gray;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔/**//*不点或成功修改标题后的样式*/
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔.notSelectTitle{}{
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    background-color:Transparent;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔}
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
</style>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
</head>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
<body>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
<form id="form1" runat="server">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
<asp:ScriptManager ID="ScriptManager1" runat="server">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            
</asp:ScriptManager>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔  
<div id="Title"   runat=server >d
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        dd
&nbsp
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
</div>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
<div class="demoarea">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
<div class="demoheading"></div>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
<id="Paragraph1"></p><br />
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
<asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to change the paragraph style" />
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
<asp:Panel ID="Panel1" runat="server" Style="display: none">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            
<asp:Panel ID="Panel3" runat="server" CssClass="modalPopup" Height="72px" Width="192px">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔                
<div>修改标题 :<br />
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔                    
<input id="TitleInPut" type=text style="width: 188px; height: 21px" /><br />
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔 
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔                        
<asp:Button ID="OkButton" runat="server" Text="OK" />
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔                        
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔                
</div>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            
</asp:Panel>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
</asp:Panel>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            TargetControlID
="Title"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            PopupControlID
="Panel1"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            OkControlID
="OkButton"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            OnOkScript
="OnCallBack('SetTitle')"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            CancelControlID
="CancelButton"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            OnCancelScript
="CanceClick('SetTitle')"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            DropShadow
="true"
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            Drag
=false
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            
PopupDragHandleControlID="Panel3"/>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
</div>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
<script type="text/javascript">
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        // The following snippet works around a problem where FloatingBehavior
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        // doesn't allow drops outside the "content area" of the page - where "content
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        // area" is a little unusual for our sample web pages due to their use of CSS
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        // for layout.
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        function setBodyHeightToContentHeight() {
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔            document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + "px";
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        }
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        setBodyHeightToContentHeight();
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔        $addHandler(window, "resize", setBodyHeightToContentHeight);    
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
</script>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔   
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔      
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔    
</form>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
</body>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
</html>
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔

//--不好意思有点长了各位是否看清楚了~~这里里用来保存数据的时 OnCallBack('SetTitle')"这个是客户端回调
赫赫我们来看看他是怎么工作的

 1TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔后台页
 2TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System;
 3TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Data;
 4TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Configuration;
 5TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Collections;
 6TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Web;
 7TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Web.Security;
 8TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Web.UI;
 9TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Web.UI.WebControls;
10TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Web.UI.WebControls.WebParts;
11TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Web.UI.HtmlControls;
12TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔using System.Xml;
13TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔public partial class Test_TitleTest : System.Web.UI.Page,System.Web.UI.ICallbackEventHandler
14


//--全部都有注释这个是个人习惯建议凡是赖同胞们统统地用因为最后交接的时候生成xml了事哈哈哈
//--这里比较重要的是
//--得到原来的数据
MB.TheBeerHouse.BLL.PageState.PageState.Current.Title;
//--去取脚本
MB.TheBeerHouse.UI.Script.ManageScript.RegisterStartupScript(Page, "RageEventRegisiter");
//--保存数据
MB.TheBeerHouse.BLL.PageState.PageState.Current.Save(eventArg.Replace("SetTitle+=", "").Replace(";", ""));

我们从最简单的开始哈哈我也懒....在吃饭以前我把我的脚本类说完TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔

TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Data;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Configuration;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Web;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Web.Security;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Web.UI;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Web.UI.WebControls;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Web.UI.WebControls.WebParts;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔
using System.Web.UI.HtmlControls;
TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔

//--又是大段的代码赫赫不好意思~~这个专题下次是最后一部分了...TheBeerHouse七:扩展篇(上)向CommunityServer一样飞翔

相关文章:

  • 2021-12-24
  • 2021-06-21
  • 2022-01-05
  • 2021-08-30
  • 2021-10-06
  • 2021-06-16
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-07-27
  • 2021-11-24
  • 2021-10-17
  • 2022-01-09
相关资源
相似解决方案