俺是初学者。不知道我样做法对不对。代码如下: For j = 0 To rst2.RecordCount - 1 Application.Set(("rcount"), Application("rcount") + 1) Response.Write("<tr>") For t = 0 To rst2.Fields.Count - 1 If t = 0 Then Response.Write("<td align=center height=15px bgcolor=#3399cc> " & "<a href=webform1.aspx target=_blank>" & "<font face=宋体 size =2px>" & rst2(t).Value & "</font>" & "</td>") Else Response.Write("<td align=center height=15px bgcolor=#3399cc> " & "<font face=宋体 size =2px>" & rst2(t).Value & "</font>" & "</td>") End If If t = 1 Then Response.Write("<td align=center width=5% height=15px bgcolor=#3399cc>") Response.Write("<input type=checkbox name=c & " & rcount & " value=on runat=server id=checkbox>") Response.Write("</td>") End If Next Response.Write("</tr>") rst2.MoveNext() Next rst.MoveNext() Next
俺是初学者。不知道我样做法对不对。代码如下: Response.Write("<input type=checkbox name=c & " & rcount & " value=on >") Response.Write("</td> Response.Write("</tr>") rst2.MoveNext() Next rst.MoveNext() Next
上面发了两次都是不对的,这次是我想要说的。俺是初学者不知道我样做法对不对。代码如下: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '在此处放置初始化页的用户代码 for i=0 to 10 <table border=0 framebox height=100% widht=100%> <tr> Response.Write("<td>") Response.Write("<input type=checkbox name=c & " & i & " value=on >") Response.Write("</td>") </tr> </table> next end sub 我的意思是:在下一页中判断那11个checkbox有几个被选中了,不知该怎么做? 大家说我这样做对不对?
还可以通过webconfig的设置对其值进行加密
在下一页使用Request["ID"],就得到传过来的值得了。如:Response.Redirect("Main.aspx?Name ="+this.txtName.Text);
string strName = Request["Name"]
Response.Redirect("Main.aspx?Name ="+this.txtName.Text);在Main.aspx页面的Page_load事件里用
Request.QueryString["Name"].ToString()
来接收
Response.Redirect("yourPageName?yourFieldName"+yourConrtols.Text.Tostring())在你的yourPageName页使用Request.QueryString["yourFieldName"].ToString()2:Session["yourFieldName"]=yourFiledName.Text.ToString();在你想用这个值的页面中String yourFieldName=Session["yourFieldName"].ToString();
For j = 0 To rst2.RecordCount - 1
Application.Set(("rcount"), Application("rcount") + 1)
Response.Write("<tr>")
For t = 0 To rst2.Fields.Count - 1
If t = 0 Then
Response.Write("<td align=center height=15px bgcolor=#3399cc> " & "<a href=webform1.aspx target=_blank>" & "<font face=宋体 size =2px>" & rst2(t).Value & "</font>" & "</td>")
Else
Response.Write("<td align=center height=15px bgcolor=#3399cc> " & "<font face=宋体 size =2px>" & rst2(t).Value & "</font>" & "</td>")
End If
If t = 1 Then
Response.Write("<td align=center width=5% height=15px bgcolor=#3399cc>")
Response.Write("<input type=checkbox name=c & " & rcount & " value=on runat=server id=checkbox>")
Response.Write("</td>")
End If
Next
Response.Write("</tr>")
rst2.MoveNext()
Next
rst.MoveNext()
Next
Response.Write("</td>
Response.Write("</tr>")
rst2.MoveNext()
Next
rst.MoveNext()
Next
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
for i=0 to 10
<table border=0 framebox height=100% widht=100%>
<tr>
Response.Write("<td>")
Response.Write("<input type=checkbox name=c & " & i & " value=on >")
Response.Write("</td>")
</tr>
</table>
next
end sub
我的意思是:在下一页中判断那11个checkbox有几个被选中了,不知该怎么做?
大家说我这样做对不对?
此为JAVASCRIPT脚本写法:
传递参数window.open("WebForm5.aspx?text="+value),"newwindow","toolbar=yes,width=600,height=600,top="+(screen.height-600)/2+",left="+(screen.width-600)/2+";,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=yes");
Response.Redirect("Main.aspx?Name ="+this.txtName.Text);在Main.aspx页面的Page_load事件里用
Request.QueryString["Name"].ToString()
来接收
我用Response.Redirect("Main.aspx?Name ="+c1)用不了。不知该怎么办好。
Response.Write("<input type=checkbox name=c1" value=on >")说是c1没有定义
1.ViewState;
2.cookie;
3.session;
4.url传值;
你的情况用第3,第4种比较方便。