|
<Script language = JavaScript> VaR I = 0; VaR rowindex = 12; Function addrow () { Otr1 = table1.insertrow (rowindex ); Otd1 = otr1.insertcell (0 ); Otd2 = otr1.insertcell (0 ); Otd3 = otr1.insertcell (0 ); Otd4 = otr1.insertcell (0 ); Otd1.innerhtml = "<input type = text name = Name" + I + "> "; Otd2.innerhtml = "<input type = text name = num" + I + "> "; Otd3.innertext = "<input type = text name = post" + I + "> "; Otd4.innertext = "<input type = text name = type" + I + "> "; I ++; Rowindex ++; } Function readvalue () { VaR info = ""; VaR objinfo = Document. getelementsbyid ("txtinfo"); // txtinfo is a server control. For (j = 0; j <I; j ++) { VaR temp = ""; VaR objname = Document. All ("name" + J ); VaR objnum = Document. All ("num" + J ); VaR objpost = Document. All ("Post" + J ); VaR objtype = Document. All ("type" + J ); Temp = temp + objname. Value + "\" + objnum. Value + "\" + objpost. Value + "\" + objtype. value; Info = info + temp; } Objinfo. value = Info; } Function deleterow () { Rowindex --; I --; Table1.deleterow (rowindex ); } Used in C # code String [] STR = textbox1.text. Split ("\\"); Extract the separated strings. Note: you cannot set the visible of txtinfo to false. Otherwise, JavaScript cannot be read. For example, <type = hidden> C # cannot be read. My approach is: set the width and height of txtinfo to 0, and bordercolor to the background color. |