佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > asp.net 保存、修改沒有 runat=server控件的控件值的一個解決方案

asp.net 保存、修改沒有 runat=server控件的控件值的一個解決方案

熱門標(biāo)簽:銀行業(yè)務(wù) 服務(wù)器配置 電子圍欄 科大訊飛語音識別系統(tǒng) Mysql連接數(shù)設(shè)置 阿里云 團購網(wǎng)站 Linux服務(wù)器

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()//頁面加載
{
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實現(xiàn)刪除DataGrid的記錄時彈出提示信息
  • asp.net中GridView和DataGrid相同列合并實現(xiàn)代碼
  • ASP.NET MVC中EasyUI的datagrid跨域調(diào)用實現(xiàn)代碼
  • ASP.NET MVC使用EasyUI的datagrid多選提交保存教程
  • asp.net DataGrid 中文字符排序的實現(xiàn)代碼
  • asp.net DataGridView導(dǎo)出到Excel的三個方法[親測]
  • 在asp.net中實現(xiàn)datagrid checkbox 全選的方法
  • 決定何時使用 DataGrid、DataList 或 Repeater(ASP.NET 技術(shù)文章)
  • asp.Net JS取母板頁控件值的簡單方法
  • Asp.net清空控件值的方法(可自定義控件類型)
  • ASP.NET中訪問DataGrid中所有控件值的方法

標(biāo)簽:衢州 棗莊 江蘇 廣元 衡水 萍鄉(xiāng) 大理 蚌埠

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp.net 保存、修改沒有 runat=server控件的控件值的一個解決方案》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    平南县| 罗甸县| 安陆市| 伊通| 乃东县| 息烽县| 闸北区| 灵山县| 双辽市| 安塞县| 徐闻县| 金华市| 江安县| 饶阳县| 庆元县| 珠海市| 嘉义市| 舒兰市| 保康县| 红河县| 宝坻区| 林西县| 调兵山市| 比如县| 廊坊市| 濮阳市| 沙洋县| 长葛市| 漳浦县| 建德市| 廊坊市| 鄂温| 淳化县| 遵义市| 平南县| 姜堰市| 南乐县| 西昌市| 拉孜县| 鄂托克旗| 宜黄县|