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 8505869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:26:25+00:00 2026-06-11T02:26:25+00:00

<HttpGet()> Public Function Search(<FromUri()> ByVal name As Name) As HttpResponseMessage // get params from

  • 0
<HttpGet()>
Public Function Search(<FromUri()> ByVal name As Name) As HttpResponseMessage
  // get params from complex type
  // or check for model validation
  name.firstName;
  name.lastName;
End Function

Public Class Name
 <Required()>
 Public firstName As String
 <Required()>
 Public lastName As String
End Class

/api/abc/search?firstName=jack&lastName=daniels

I am trying to send a comlex type as a query parameter but name is always null even though I am using fromUri attribute. What am I missing?

EDIT: I am also using Required() attribute from System.ComponentModel.DataAnnotations .

  • 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-11T02:26:27+00:00Added an answer on June 11, 2026 at 2:26 am

    I found the problem. I was missing the Property keywords on my fields.

    Public Class Name
     <Required()>
     Public firstName As String
     <Required()>
     Public lastName As String
    End Class
    

    So, it worked with the following change.

    Public Class Name
     <Required()>
     Public Property firstName As String
     <Required()>
     Public Property lastName As String
    End Class
    

    The problem solved. I think, without properties, the class does not expose its fields, so I cant read them from uri.

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

Sidebar

Related Questions

public String getBrotherHood() throws Exception{ client = new DefaultHttpClient(); get = new HttpGet(uri); res
Have Controller: public class MyController : Controller { [HttpGet] public ActionResult MyAction(int iMode, string
I have the following controller action: [HttpGet] public JsonpResult getTestValues(int? entityId, int? id) {
I have an Index Action: [HttpGet] public ActionResult Index (bool Myparam, ...) { if(Myparam)
Not sure what's going on here... My controller methods looks like this: [HttpGet] public
I got an action List //[HttpGet] (will come back to that!) public ViewResult List(int
I'm returning data from a HttpGet and then passing the string(s) into a Listview
My app has a function where it takes user input and then calls HttpGet
The http.get() function inside http.createServer is not responding. I wrote a small snippet to
Hi I'm having the following two actions defined in my controller [Authorize] [HttpGet] public

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.