摘要: <sessionState mode="[Off|InProc|StateServer|SQLServer|Custom]" timeout="number of minutes" cookieName="session identifier cookie name" cookieless= "[true|false|AutoDetect|UseCookies|UseUri|UseDeviceProfile]" regenerateExpiredSessionId="[True|False阅读全文
posted @ 2011-01-04 09:12 张宏宇 阅读(189) 评论(0) 编辑

create table #tmp (name varchar(50),rows int,reserved varchar(50),data varchar(50),index_size varchar(50),unused varchar(50));

insert into #tmp (name,rows,reserved,data,index_size,unused) exec sp_msforeachTable "sp_spaceused '?'"

select
*,
--sum(
convert(decimal,replace(reserved,' KB',''))
+convert(decimal,replace(data,' KB',''))
+convert(decimal,replace(index_size,' KB',''))
+convert(decimal,replace(unused,' KB',''))
--)
 from #tmp

drop table #tmp

posted @ 2012-02-16 09:22 张宏宇 阅读(9) 评论(0) 编辑

JS:

 

   document.onkeydown=setCode;
function setCode(){
            if (event.keyCode==40)
            {
                var srcElem = document.activeElement
                var testval = srcElem.name;
                if(testval=="TextAdmissionDiagnosis")
                {
                   document.getElementById("lsBoxInfo").focus();
                }
            }
            if(event.keyCode==13)
            {

                    event.returnValue   =   false;
                    var srcElem = document.activeElement
                    var testval = srcElem.name;
                    if(testval=="lsBoxInfo")
                    {
                       getData();
                    }
            }
}
   
      function getSelect(a) {
               if(a.value=="")
                    return;
               var CheckIdList=MedicalTwo_AddMedicalTwo.GetLC_RememberCode(a.value).value;
                if(CheckIdList.length != 0)
                {
                                            document.getElementById("lsBoxInfo").style.display="block";
                                      var slt = document.getElementById("lsBoxInfo");
                                  
                                            for (i = slt.options.length - 1; i >= 0; i--) {
                                                 slt.options.remove(i);
                                            }
                                                        for (i = 0; i < CheckIdList.length; i++) {
                                                            option = new Option();
                                                            option.text = CheckIdList[i].split('@')[0];
                                                            option.value = CheckIdList[i].split('@')[1];
                                                            slt.options.add(option);
                                                        }
                }else
                {
                      document.getElementById("lsBoxInfo").style.display="none";
                }

           
         
      }
            function getData()
            {
          
                var province=document.getElementById("lsBoxInfo");
                var pindex = province.selectedIndex;
                var pValue = province.options[pindex].value;
                var pText  = province.options[pindex].text;                                               
                document.getElementById("TextAdmissionDiagnosis").innerText=pText;
                document.getElementById("lsBoxInfo").style.display="none";

               
            }
            function Setoubl()
            {
                var srcElem = document.activeElement
                var testval = srcElem.name;
                if(testval != "TextAdmissionDiagnosis" && testval!="lsBoxInfo")
                {
                    document.getElementById("lsBoxInfo").style.display="none";
                }
            }

 

Html:

     <td class="right_chaxun_bai" align="left" colspan="3" style="height: 24px; position:relative;">
                                                         <div id="divPropertyInfo" style="position:absolute;  z-index:20; ; width:100%; left: 0px; top: 0px;">
                                                                <input id="TextAdmissionDiagnosis" type="text" runat="server" style="width: 90%"  class="right_chaxun_input"   AutoComplete="off" />
                                                         </div>
                                                         <select id="lsBoxInfo" runat="server" style="display: none;position:absolute;  z-index:20; top:20px; width:90%;" multiple="true" ></select>
                                                     
                                                </td>

事件:

 

         this.TextAdmissionDiagnosis.Attributes.Add("onblur", "Setoubl();");
            this.TextAdmissionDiagnosis.Attributes.Add("onkeyup", "getSelect(this);");

            this.lsBoxInfo.Attributes.Add("onblur", "Setoubl();");
            //双击
            this.lsBoxInfo.Attributes.Add("ondblclick", "getData();")

 

posted @ 2011-09-09 10:36 张宏宇 阅读(55) 评论(0) 编辑

                                   var top = $("#TextAdmissionDiagnosis").position().top + $("#TextAdmissionDiagnosis").height();
                                    $("#divPropertyInfo").css({
                                        top: top,
                                        left: $("#TextAdmissionDiagnosis").position().left

                                    });
                                    $("#divPropertyInfo").slideToggle(500);
                                    $("#divPropertyInfo").hover(
                              function() {

                              }, function() {
                                  $("#divPropertyInfo").slideUp(500);
                              });

 

 

 <div id="divPropertyInfo" style="position: absolute; z-index: 20; display: none; width:40%;">
                                                            <asp:ListBox ID="lsBoxInfo" runat="server"   Width="90%" Height="60%" >
                                                            </asp:ListBox>
        </div>

posted @ 2011-09-09 09:59 张宏宇 阅读(17) 评论(0) 编辑

                                                <td class="right_chaxun_bai " align="left" width="17%" style="height: 24px;position:relative">
                                                  
   <div id="Layer1"   style="position:absolute;  width:16%;  z-index:0;left:0px;top:0px;margin-top:0px;">
                                                              <asp:DropDownList ID="TextHospitalName" runat="server" Width="150px">
                                                              </asp:DropDownList>
                                                        </div>
    <div   id="Layer2"   style="position:absolute; width:16%;  z-index:200;left:0px; top:0px;margin-top:0px;">
                                                         <asp:TextBox ID="TextHospitalName123" runat="server" Width="130px" CssClass="right_chaxun_input" ></asp:TextBox>
                                                       </div>
                                                 
                                                </td>

 

1 在后台,给下拉框挂事件

   this.TextHospitalName.Attributes.Add("onchange", "TextHospitalName123.value=this[selectedIndex].text");

2 主要使用DIV属性,position布局,z-index属性

 

定义和用法

position 属性规定元素的定位类型。

说明

这个属性定义建立元素布局所用的定位机制。任何元素都可以定位,不过绝对或固定元素会生成一个块级框,而不论该元素本身是什么类型。相对定位元素会相对于它在正常流中的默认位置偏移。

 

可能的值

描述
absolute

生成绝对定位的元素,相对于 static 定位以外的第一个父元素进行定位。

元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。

fixed

生成绝对定位的元素,相对于浏览器窗口进行定位。

元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。

relative

生成相对定位的元素,相对于其正常位置进行定位。

因此,"left:20" 会向元素的 LEFT 位置添加 20 像素。

static 默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。
inherit 规定应该从父元素继承 position 属性的值。

 

 

z-index 属性设置元素的堆叠顺序。拥有更高堆叠顺序的元素总是会处于堆叠顺序较低的元素的前面。

注释:元素可拥有负的 z-index 属性值。

注释:Z-index 仅能在定位元素上奏效(例如 position:absolute;)!

说明

该属性设置一个定位元素沿 z 轴的位置,z 轴定义为垂直延伸到显示区的轴。如果为正数,则离用户更近,为负数则表示离用户更远。

 

 

posted @ 2011-09-09 09:47 张宏宇 阅读(108) 评论(0) 编辑
[AjaxMethod(HttpSessionStateRequirement.ReadWrite)] // 读写Session:

[AjaxMethod(HttpSessionStateRequirement.Read)] // 只读Session:
【服务器端】

 

 

[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]

public string getTest()

{

 

Hashtable hash = (Hashtable)HttpContext.Current.Session["UserName"];


 

}
Session以及Application 、Request等,都是由Page类继承下来的(你可以this.Session点出来),而用Ajax.net对后台方法访问的时候,这些方法并不属于Page类,所以才需要从HttpContext.Current中读取。而Session又更特别些,需要加[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]才能被访问。

posted @ 2011-09-08 09:18 张宏宇 阅读(26) 评论(0) 编辑

declare @procName varchar(500)

declare cur cursor

for select [name] from sys.objects where type = 'p'

open cur

fetch next from cur into @procName

while @@fetch_status = 0

begin

if @procName <> 'DeleteAllProcedures'

exec('drop procedure ' + @procName)

fetch next from cur into @procName

end

close cur

deallocate cur

posted @ 2011-08-16 15:00 张宏宇 阅读(4) 评论(0) 编辑

HTML中禁止自动完成和禁用输入法收藏

      IE提供了一个自动完成功能可以记忆我们的输入内容(如登录帐号等),方便下一次快速地录入类似资料.这确实是一个非常友好的功能, 在操作时只需用鼠标双击文本框或输入前几个字符, 系统会自动列出以前的录入历史供你选择, 大大提高录入速度及准确性. 相信大多数IE的用户都启用了这项功能.
      然而做为网站开发者来说, 并不希望什么资料都记忆在用户的电脑上(如银行帐号和其它重要的帐号及密码), 但是我们又不能要求用户禁用自动完成的功能. 幸好IE5.0后为 INPUT type=password, INPUT type=text, FORM 等控件加入了一个 AUTOCOMPLETE的属性,要禁止控件自动完成功能,只需把AUTOCOMPLETE设为off即可,如:
整个表单禁止自动完成
<FORM method=post action="submit.asp" AUTOCOMPLETE="OFF">
禁止文本框自动完成
<input type="text" name="creditcard" maxlength="16" AUTOCOMPLETE="OFF">
在脚本中禁止自动完成
function init()
{
    element.setAttribute("AutoComplete", "off");
}

另外,如果要禁止文本框使用输入法,可以把在它的样式中添加 ime-mode : disabled 即可,但是这样并不能禁止输入汉字,因为用户还是可以通过复制粘贴输入汉字的.如:
<input type=text style="ime-mode: disabled ; ">

微软的.NET PASSPORT 就是这样实现的,但是因该还会有其它的方法,因为在YAHOO 和 GMAIL的实现方法就不一样。

 

TextBox控件有什么新鲜内容?嗯!有个看似很小但却常带来困扰的小“改良”,就是“自动完成”(AutoComplete)。何谓自动完成呢?也就是TextBox会记忆用户曾经输入过的文字,当下次再输入时就会自动提示相关字词,最常见的是用户登录网站时就会自动带出帐号密码。

这个功能在最早被发明时大家觉得很方便很好用,但随着信息安全意识的加强,这个功能有时不但不讨人喜欢,反而有点令人厌恶,为什么呢?现在无论是在家中、网吧还是公司,多人共享一台计算机的机会很多,而也是由于TextBox的自动完成在作祟的缘故,他人要看你的E-mail甚至假借您的帐号登录网页并非难事,只要在TextBox中选取你的帐号后,密码通常会一并自动带出。

关于这个恼人的问题,我接连被朋友问道该如何解决。在ASP.NET 2.0的TextBox控件内置的AutoCompleteType属性可以轻易解决这个问题,只要将TextBox的AutoCompleteType设置为“Disable”后,自动完成提示便完全不会出现了

posted @ 2011-07-31 13:35 张宏宇 阅读(194) 评论(0) 编辑
摘要: ASP.NET清除页面缓存 (1) Response.Buffer = true; Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1); Response.Expires = 0; Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "No-Cache"); (2) HTML方法 <HEAD> <META HTTP-EQUIV="Pragma" CO阅读全文
posted @ 2011-06-21 14:42 张宏宇 阅读(112) 评论(0) 编辑
摘要: 下表列出了由 SqlBulkCopy 类型公开的成员。 公共构造函数 名称 说明 SqlBulkCopy 已重载。初始化 SqlBulkCopy 类的新实例。页首 公共属性 名称 说明 BatchSize 每一批次中的行数。在每一批次结束时,将该批次中的行发送到服务器。 BulkCopyTimeout 超时之前操作完成所允许的秒数。 ColumnMappings 返回 SqlBulkCopyColumnMapping 项的集合。列映射定义数据源中的列和目标表中的列之间的关系。 DestinationTableName 服务器上目标表的名称。 NotifyAfter 定义在生成通知事件之...阅读全文
posted @ 2011-06-08 09:29 张宏宇 阅读(69) 评论(0) 编辑
摘要: 的数据作为分区重新分配给现有的已分区表,或者将分区由一个已分区表切换到另一个已分区表,则目标分区必须存在,并且必须为空。 如果重新分配一个分区的数据以组成单个表,则必须已经创建了目标表,并且该表必须为空。源表或分区以及目标表或分区必须在同一个文件组中。对应的索引或索引分区也必须在同一个文件组中。切换分区还有许多其他限制。有关详细信息,请参阅使用分区切换高效传输数据。table和target_table不能相同。target_table可以是由多个部分构成的标识符。source_partition_number_expression和target_partition_number_express阅读全文
posted @ 2011-04-12 08:44 张宏宇 阅读(24) 评论(0) 编辑