首页
VS Code教程
(current)
VS Code插件
(current)
VS Code打造IDE
(current)
VScode更新日志
(current)
关于
asp.net 保存、修改没有 runat=server控件的控件值的一个解决方案
358
人浏览 /
0
人评论
js:
复制代码
代码如下:
function Save()//保存不是服务端控件的值
{
var 1= document.getElementById('1Box').value;
var 2 = document.getElementById('2Box').value;
var TxtValue = 1 + "■" + 2;
document.getElementById('3).value = TxtValue;
return true;
}
window.onload=function show()
{
var TxtValue = document.getElementById('3).value;
if (TxtValue != "") {
EachValue = new Array();
EachValue = TxtValue.split('■');
document.getElementById('1Box').value = EachValue[0];
document.getElementById('2Box').value = EachValue[1];
}
return true;
}
html:
复制代码
代码如下:
CS:
复制代码
代码如下:
void LoadData()//页面加载
{
btnSave.Attributes.Add("onclick", "javascript:Save();");
string[] strTxtValues = new string[2];
strTxtValues[0] = dr["1"].ToString();
strTxtValues[1]=dr["2"].ToString();
string strValues = strTxtValues[0];
for (int i = 1; i < strTxtValues.Length; i++)
{
strValues += "■" + strTxtValues[i];
}
this.3.Value = strValues;
}
private void SaveOrUpdate()//保存、修改
{
string[] strTxtValues = this.3.Value.Split('■');
string 1= strTxtValues[0];
string 2= strTxtValues[1];
您可能感兴趣的文章:
asp.net DataGrid控件中弹出详细信息窗口
asp.net实现删除DataGrid的记录时弹出提示信息
asp.net中GridView和DataGrid相同列合并实现代码
ASP.NET MVC中EasyUI的datagrid跨域调用实现代码
ASP.NET MVC使用EasyUI的datagrid多选提交保存教程
asp.net DataGrid 中文字符排序的实现代码
asp.net DataGridView导出到Excel的三个方法[亲测]
在asp.net中实现datagrid checkbox 全选的方法
决定何时使用 DataGrid、DataList 或 Repeater(ASP.NET 技术文章)
asp.Net JS取母板页控件值的简单方法
Asp.net清空控件值的方法(可自定义控件类型)
ASP.NET中访问DataGrid中所有控件值的方法
相关文章
如何有效避免设计作品“空”?
高点击率钻展,设计环节…
无敌配色技巧(一)
留言
全部评论
晴天下起了小雨
2017-10-01 18:00
很喜欢,果断关注了
回复
wjmyly7336064
2017-10-01 18:00
相当实用,赞美了
橘大佬
2017-10-01 18:00
就是有些细节再到位点就好了…
回复
微信公众号
关注微信公众号获取更多VSCode编程信息,定时发布干货文章
最新文章
What's the make money?
MySQL 9.0 的新增功能
Apple 在 iOS 17 中使用 Swift 和 SwiftUI
编写更多“无用”软件
windows 修改环境变量后在 vscode 的终端不生效的两种解决方法
整理列出PHP各个版本5.2至8.0、8.1的特性以及区别
unicode 表情对照表
Stable Diffusion(AI绘画)Lora模型BRA V4发布:AI生成东亚人照片的生态可能因此改变
热门标签
VSCode
python
php
插件
防火墙
nodejs
远程开发
linux
virtualenv
flutter
安卓
苹果
图标主题
mysql
VScode插件
全部评论