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
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();")
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>
<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 轴定义为垂直延伸到显示区的轴。如果为正数,则离用户更近,为负数则表示离用户更远。
public string getTest()
{
}
Session以及Application 、Request等,都是由Page类继承下来的(你可以this.Session点出来),而用Ajax.net对后台方法访问的时候,这些方法并不属于Page类,所以才需要从HttpContext.Current中读取。而Session又更特别些,需要加[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirem
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
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”后,自动完成提示便完全不会出现了