vb.net 将值从一个aspx发送到另一个aspx
这是我的 vb.net 代码 -
在我的子例程中 -
Private Sub xxx()
Sqlstr = "SELECT * FROM table"
ExecuteNonQuery(Sqlstr)
SqlCmd = New SqlCommand(Sqlstr, SqlCnn)
SqlDR = SqlCmd.ExecuteReader
If SqlDR.HasRows Then
Do While SqlDR.Read()
r = New TableRow
Dim l As New LinkButton
l.Text = SqlDR("column_name")
l.Attributes.Add("onClick", "setAction(" + CStr(SqlDR("id")) + ",'edit')")
l.ID = SqlDR("id")
c = New TableCell
c.Controls.Add(l)
r.Cells.Add(c)
....
因此,当人们单击我在此处提供的超链接时,我转到 page_load 并执行此操作,
If (Me.pageAction.Value = "edit") Then
Response.Redirect("next.aspx?id=" ???? - i dont know what to put here.
End If
我希望 next.aspx 页面具有单击的编辑值上(所以ID值)
我做这整件事是正确的还是有人有更好的解决方案,更简单和更干净的解决方案?
this is my vb.net code -
in the subroutine i have -
Private Sub xxx()
Sqlstr = "SELECT * FROM table"
ExecuteNonQuery(Sqlstr)
SqlCmd = New SqlCommand(Sqlstr, SqlCnn)
SqlDR = SqlCmd.ExecuteReader
If SqlDR.HasRows Then
Do While SqlDR.Read()
r = New TableRow
Dim l As New LinkButton
l.Text = SqlDR("column_name")
l.Attributes.Add("onClick", "setAction(" + CStr(SqlDR("id")) + ",'edit')")
l.ID = SqlDR("id")
c = New TableCell
c.Controls.Add(l)
r.Cells.Add(c)
....
so when the person clicks on the hyperlink that i have provided here, i goto page_load and do this
If (Me.pageAction.Value = "edit") Then
Response.Redirect("next.aspx?id=" ???? - i dont know what to put here.
End If
i want the next.aspx page to have the value of edit that was clicked on (so the ID value)
Am i doing this whole thing right or does someone have a better solution, simpler and cleaner one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要将其返回到下一页:
您可能想看看这篇文章 了解更多详情。
To get it back in the next page:
You might wanna ahve a look at this article for further details.