你好,我正试图从骨髓脏取ID 并把它发送到科林特那边,这是我做了什么。
这是我的骨髓:
http://localhost:53010/edit.aspx?Id=4
后面的代码
Public Partial Class Edit
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
End Sub
Private _myId As String = Request.QueryString("id")
Public Property myId() As String
Get
Return _myId
End Get
Set(ByVal value As String)
_myId = value
End Set
End Property
结束类 client
<%= myId%>
错误
Request is not available in this context
this is also what i get when i move the private prop to page_load() "private " is not valid on local variable declaration – any idea what is going on
谢谢 谢谢
我在这里解决问题就是答案
Public Partial Class Edit
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
MyIdVal = Request.QueryString("id")
End Sub
Private _myIdVal As String
Public Property MyIdVal() As String
Get
Return _myIdVal
End Get
Set(ByVal value As String)
_myIdVal = value
End Set
End Property
结束类