最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp.net 保存、修改沒(méi)有 runat=server控件的控件值的一個(gè)解決方案

 更新時(shí)間:2011年10月21日 10:59:20   作者:  
asp.net 保存、修改沒(méi)有 runat=server控件的控件值的一個(gè)解決方案,需要的朋友可以參考下。

js:

復(fù)制代碼 代碼如下:

function Save()//保存不是服務(wù)端控件的值
{
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:
復(fù)制代碼 代碼如下:

<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:
復(fù)制代碼 代碼如下:

void LoadData()//頁(yè)面加載
{
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];

相關(guān)文章

最新評(píng)論

洛阳市| 九龙县| 东丽区| 聂荣县| 灵山县| 小金县| 吉水县| 东港市| 洞头县| 赤壁市| 南昌市| 昆山市| 游戏| 饶平县| 祁门县| 土默特右旗| 桐乡市| 习水县| 钦州市| 鄂尔多斯市| 渭源县| 成都市| 阳谷县| 武乡县| 卓尼县| 揭东县| 永年县| 巴塘县| 汾阳市| 昔阳县| 昌黎县| 长宁县| 军事| 明光市| 孝感市| 永靖县| 游戏| 浦东新区| 西林县| 富源县| 银川市|