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

  • SEARCH
  • Home
  • 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 8584905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:53:01+00:00 2026-06-11T21:53:01+00:00

I assume I am missing something very basic, but here is my plight. In

  • 0

I assume I am missing something very basic, but here is my plight. In VB.net, I have created a class that inherits MembershipUser and returns the object from a web service:

Public Class ModifiedUser
    Inherits MembershipUser

The user logs in:

Private Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
    Dim ws As New MembersWS.Members
    Dim Member As New MembersWS.ModifiedUser
    ws.Credentials = System.Net.CredentialCache.DefaultCredentials()
    Member = ws.ValidateUser(Login1.UserName, Login1.Password)
End Sub

When the object is created in the web service, ModifiedUser contains all of the properties of MembershipUser as well as the properties of the new class.

In my example, the ValidateUser function validates the user and adds the additional properties:

Public Function ValidateUser(ByVal UserName As String, ByVal Password As String) As ModifiedUser
    Dim BaseUser As MembershipUser = Membership.Provider.GetUser(UserName, False)
    Dim Member As New ModifiedUser
    If Membership.Provider.ValidateUser(UserName, Password) = True Then 
        Member = New ModifiedUser(BaseUser.ProviderName, BaseUser.UserName, BaseUser.ProviderUserKey, BaseUser.Email, BaseUser.PasswordQuestion, BaseUser.Comment, BaseUser.IsApproved, BaseUser.IsLockedOut, BaseUser.CreationDate, BaseUser.LastLoginDate, BaseUser.LastActivityDate, BaseUser.LastPasswordChangedDate, BaseUser.LastLockoutDate, 0, "", "", "", "", True)
        ' ... (Set new property values)
    End if
    Return Member
End Function

When Member is returned to Login1_Authenticate, the readonly properties are dropped from the object while they were included in the object being returned from the web service.

In the reference.vb file for the web service, the auto-generated code includes a partial MembershipUser class including only the updateable properties with the associated getters and setters:

Partial Public Class MembershipUser
    Private emailField As String
    Private commentField As String
    Private isApprovedField As Boolean
    Private lastLoginDateField As Date
    Private lastActivityDateField As Date

If anyone can let me know how to include the readonly properties in the returned object, I’d really appreciate it.

  • 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-11T21:53:02+00:00Added an answer on June 11, 2026 at 9:53 pm

    When a web service returns an object that contains read-only properties, the read-only properties are always ignored. That is because on the client-side, it would not be able to deserialize the data by setting the value of the read-only property. One way to fix this is to add a setter to your property which does nothing or throws an exception. For instance:

    Public Property Id() As Integer
        Get
            Return nID
        End Get
        Set(ByVal Value As Integer)
            Throw New Exception("Cannot set read-only property 'Id'")
        End Set
    End Property
    

    See this question for more ideas:

    Is it possible to create read only elements in SOAP web services?

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

Sidebar

Related Questions

I assume I'm missing something really trivial here but for reason it's not obvious
I am certain that I am missing something very obvious, but... I want to
I have to assume I am missing something simple, or I am not understanding
I'm running into a mental roadblock here and I'm hoping that I'm missing something
I assume this is really easy, and I'm missing something obvious. I'm connecting to
Assume that we have two sets: A=(a_1,a_2,...,a_m) and B=(b_1,b_2,...,a_n) (Not necessarily of same size).
I have created a custom control (based on a panel) in wxPython that provides
Platform: ASP.NET 3.5, ASP.NET Ajax intermixed I'm very green to jQuery, so have been
I'm not sure if I am completely mad or missing something but I am
I am sure I am missing something very obvious, as I new to Jquery.

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.