locked
CS1501: No overload for method 'Profile' takes 1 arguments RRS feed

  • Question

  • User-804303021 posted

    Hi

    I am new in Webmatrix and HTML ...

    I am using the following example and I am receiving the above error in the Twitter code line. What I am missing?

    @{
        
    }
     
     
    <!DOCTYPE html>
     
    <html lang="en">
        <head>
            <meta charset="utf-8" />
            <title></title>
        </head>
        <body>
            <p> hello world </p>
          
            <h1>Twitter Feed</h1>
     
        
            <h2>My Twitter Profile</h2>
            @Twitter.Profile("Obama")
     
     
        </body>
    </html>
    
    Thursday, September 25, 2014 10:58 AM

Answers

  • User-821857111 posted

    I think you are following an example that features the old Twitter helper, but you are using the new version of the helper. It requires a second argument which is the widget ID. See this article for more information on that and an example with an ID that should work for you: http://www.asp.net/web-pages/overview/getting-started/twitter-helper

    @Twitter.Profile("aspnet", "370310677673422848")
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 26, 2014 6:44 AM

All replies

  • User379720387 posted

    This means the method is expecting additional arguments beyond the one you have, separated by commas.

    Thursday, September 25, 2014 11:07 AM
  • User895691971 posted

    Pretty strange this going on. Because even in the API, it has been stated that this method would take one string. http://www.asp.net/web-pages/overview/more-resources/asp-net-web-pages-api-reference

    I believe, you need to report it. 

    As wavemaster is saying, this is true what he is saying. But not in this scenario I guess. 

    Thursday, September 25, 2014 11:11 AM
  • User-821857111 posted

    What code sample are you following?

    Thursday, September 25, 2014 3:15 PM
  • User-804303021 posted

    Thanks. I just following Webmatrix  example

    Friday, September 26, 2014 5:52 AM
  • User-821857111 posted

    I think you are following an example that features the old Twitter helper, but you are using the new version of the helper. It requires a second argument which is the widget ID. See this article for more information on that and an example with an ID that should work for you: http://www.asp.net/web-pages/overview/getting-started/twitter-helper

    @Twitter.Profile("aspnet", "370310677673422848")
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 26, 2014 6:44 AM
  • User895691971 posted

    What is the second parameter in this one? Some API code etc?

    I believe, the team should also try to edit the API, where they're still having the single argument function call.

    Friday, September 26, 2014 8:40 AM
  • User-821857111 posted

    What is the second parameter in this one? Some API code etc?

    No - as I said, its the Widget ID

    I believe, the team should also try to edit the API, where they're still having the single argument function call.

    They can't. Twitter requires both pieces of information.

    Friday, September 26, 2014 8:50 AM
  • User895691971 posted

    Afzaal.Ahmad.Zeeshan

    I believe, the team should also try to edit the API, where they're still having the single argument function call.

    They can't. Twitter requires both pieces of information.

    I apologize for the ambiguity! I meant, they need to edit the API reference page. Not the API. :-)

    Friday, September 26, 2014 11:07 AM