最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

asp.net 保存、修改没有 runat=server控件的控件值的一个解决方案

来源:动视网 责编:小采 时间:2020-11-27 22:42:40
文档

asp.net 保存、修改没有 runat=server控件的控件值的一个解决方案

asp.net 保存、修改没有 runat=server控件的控件值的一个解决方案:js: 代码如下:function Save()//保存不是服务端控件的值 { var 1= document.getElementById('1Box').value; var 2 = document.getElementById('2Box').value; var TxtValue = 1 + ■ + 2; document.g
推荐度:
导读asp.net 保存、修改没有 runat=server控件的控件值的一个解决方案:js: 代码如下:function Save()//保存不是服务端控件的值 { var 1= document.getElementById('1Box').value; var 2 = document.getElementById('2Box').value; var TxtValue = 1 + ■ + 2; document.g


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:
代码如下:

<input type="text" id="1Box" class="txt-underline" style="width: 60px;text-align:left " maxlength="10"/>
<input type="text" id="2Box" class="txt-underline" style="width: 200px;text-align:left" maxlength="30"/>
<input type="hidden" id="3" name="Values" runat="server" />

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 保存、修改没有 runat=server控件的控件值的一个解决方案

asp.net 保存、修改没有 runat=server控件的控件值的一个解决方案:js: 代码如下:function Save()//保存不是服务端控件的值 { var 1= document.getElementById('1Box').value; var 2 = document.getElementById('2Box').value; var TxtValue = 1 + ■ + 2; document.g
推荐度:
标签: 保存 一个 修改
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top