关于js控件给服务端赋值的问题
如题
这个问题比较棘手,
在网上查找了比较多这样的资料,普遍网友认为不能实现,其实能不能答案是肯定的,
.net功能如此强大。。。。
昨天看了一个贴,说可以能用cookies来实现,想想也有道理,
就拿本网站的记录登录2周的功能,我估计就是拿cookies记录用户当前id信息,时间为2周,
现在有一案例,等待高手
<script language="JavaScript">
<!--
function bold(){
Qr=document.selection.createRange().text;
if(!Qr || document.selection.createRange().parentElement().name!='description')
{
txt=prompt('输入需要加粗的文字.','');
if(txt!=null && txt!='') document.form1.description.value+=''+txt+'';
}
else{
document.selection.createRange().text=''+document.selection.createRange().text+'';
document.selection.empty();
}
}
//-->
</script>
<input type="button" value="加粗" onclick="bold();" id="Button1" />
<textarea name="description" style="width: 436px; height: 296px">选中我,点击加粗 </textarea>
<br />
<asp:Label ID="a" runat="server" Text="Label"> </asp:Label>
<asp:TextBox ID="b" runat="server"> </asp:TextBox> </div>
</form>
现在加入一个服务端的button,如何使按下button后使得已经赋值的textarea的值发送个服务端???
又或者让textarea的值赋给服务端能取的session,使用cookies??????
等待
这个问题比较棘手,
在网上查找了比较多这样的资料,普遍网友认为不能实现,其实能不能答案是肯定的,
.net功能如此强大。。。。
昨天看了一个贴,说可以能用cookies来实现,想想也有道理,
就拿本网站的记录登录2周的功能,我估计就是拿cookies记录用户当前id信息,时间为2周,
现在有一案例,等待高手
<script language="JavaScript">
<!--
function bold(){
Qr=document.selection.createRange().text;
if(!Qr || document.selection.createRange().parentElement().name!='description')
{
txt=prompt('输入需要加粗的文字.','');
if(txt!=null && txt!='') document.form1.description.value+=''+txt+'';
}
else{
document.selection.createRange().text=''+document.selection.createRange().text+'';
document.selection.empty();
}
}
//-->
</script>
<input type="button" value="加粗" onclick="bold();" id="Button1" />
<textarea name="description" style="width: 436px; height: 296px">选中我,点击加粗 </textarea>
<br />
<asp:Label ID="a" runat="server" Text="Label"> </asp:Label>
<asp:TextBox ID="b" runat="server"> </asp:TextBox> </div>
</form>
现在加入一个服务端的button,如何使按下button后使得已经赋值的textarea的值发送个服务端???
又或者让textarea的值赋给服务端能取的session,使用cookies??????
等待
...全文
相关推荐
如何为Datetimepicker控件赋值日期
源码链接: https://pan.quark.cn/s/5f6037670e72 怎样为Datetimepicker组件进行日期数据的设定?
JavaScript第一讲:可以做什么
NULL 博文链接:https://wanghongxu.iteye.com/blog/627563
Python django Extjs 项目开发中的错误小记
主要是一些我遇到过的小错误bug,包括Python django Extjs;还有实现一些新功能时的小记
ajax框架-dwr实战-(包括整合)
ajax dwr 实战 整合ajax框架-dwr实战-(包括整合)
解决 JScript 中使用日期类型数据时出现类型错误的问题
在服务端JScript中,有些时候需要使用日期类型的数据,比如说设置一个cookie的到期时间,更新数据库中的日期字段等。但是按照平常的方法来用js里的date类型数据时,运行时就会发生错误。


