Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:37:58+00:00 2026-06-04T05:37:58+00:00

hello iam trying to get the id from a url and send it to

  • 0

hello iam trying to get the id from a url and send it to the clint side this is what i did

this is my url :

http://localhost:53010/edit.aspx?Id=4

code behind

    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

End Class
client

<%= myId%>

error

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

Thanks


i solve this problem here is the answer

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

End Class

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:38:00+00:00Added an answer on June 4, 2026 at 5:38 am

    That’s a field initializer.
    Field initializers run before the constructor and cannot access the instance they’re initializing.
    Therefore, you can’t use the Request property there.

    You need to move that to the constructor or Page_Load.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am new at Haskell and i'm having problems trying to get this
Hello I am trying to get the options from a html select element. The
Hello I am trying to figure out how to get data from my worker
Hello fellow developers! I am trying to get the build error codes from a
Hello I am trying to get the entire total page size with HttpWebRequest from
I am trying to get back a string from its hash value? string str=Hello;
Hello I am trying to get the user profile picture and then merge into
Hello everyone I am trying to resize an image of 700kb with imagecreatefromjpeg. This
I have some trouble with python. I am trying to get output from a
hello friends i am trying to get a list of user id and want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.