asp.net mvc - Updating Twitter status using LinqToTwitter -


here's set out do:

  1. make mvc app on user clicks button , taken twitter login page
  2. after giving credentials user redirected second page
  3. on secong page there text box , 'tweet' button
  4. entering message , clicking on 'tweet' update status

i got till 2nd point following samples linqtotwitter codeplex page.

the code oauth controller works fine , redirect mvc app's second page.

but missing not posting status.

this code in button click pass user entered status:

public actionresult status(string status)     {         var auth = new mvcauthorizer         {             credentialstore = new sessionstatecredentialstore()         };          auth.completeauthorizeasync(request.url);          var twittercontext = new twittercontext(auth);          tweetasync(twittercontext, status);          return view(); //return view user     }      void tweetasync(twittercontext twitterctx, string statustoupdate)     {         var tweet =  twitterctx.tweetasync(statustoupdate);          if (tweet != null)         {           // inform user success         }      }  

both above methods in oauth controller.

can please me this?

thanks in advance.

change method use async , return task:

public async task status(string status) { //...

    var tweet = await twittercontext.tweetasync(twittercontext, status);      // ... } 

and await tweetasync, assigning response status entity named tweet. if want separate method calling tweetasync, make async also. async, must make every method in call chain async.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -