summaryrefslogtreecommitdiffstats
path: root/samples/OAuthConsumer/Twitter.aspx.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-01-17 21:44:30 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-01-17 21:44:30 -0800
commita16b9b9222da75b43a44cfde9de912bba4c09670 (patch)
tree5429e7a464fa77bf61ce111efe686183745e3537 /samples/OAuthConsumer/Twitter.aspx.cs
parent9a77154c54439bacd06938e2c0624c69d4e48c69 (diff)
parentcdb850c6cf90381e6db75365272b7d65ef5fe359 (diff)
downloadDotNetOpenAuth-a16b9b9222da75b43a44cfde9de912bba4c09670.zip
DotNetOpenAuth-a16b9b9222da75b43a44cfde9de912bba4c09670.tar.gz
DotNetOpenAuth-a16b9b9222da75b43a44cfde9de912bba4c09670.tar.bz2
Merge branch 'master' into master-Dev10
Conflicts: build.proj lib/DotNetOpenAuth.BuildTasks.dll lib/DotNetOpenAuth.BuildTasks.pdb src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs src/DotNetOpenAuth.Test/Messaging/MultiPartPostPartTests.cs src/DotNetOpenAuth.sln src/DotNetOpenAuth.vsmdi src/DotNetOpenAuth/OAuth/OAuthStrings.Designer.cs
Diffstat (limited to 'samples/OAuthConsumer/Twitter.aspx.cs')
-rw-r--r--samples/OAuthConsumer/Twitter.aspx.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/samples/OAuthConsumer/Twitter.aspx.cs b/samples/OAuthConsumer/Twitter.aspx.cs
index 9b9eced..f309396 100644
--- a/samples/OAuthConsumer/Twitter.aspx.cs
+++ b/samples/OAuthConsumer/Twitter.aspx.cs
@@ -75,4 +75,20 @@ public partial class Twitter : System.Web.UI.Page {
tableBuilder.Append("</table>");
resultsPlaceholder.Controls.Add(new Literal { Text = tableBuilder.ToString() });
}
+
+ protected void uploadProfilePhotoButton_Click(object sender, EventArgs e) {
+ if (profilePhoto.PostedFile.ContentType == null) {
+ photoUploadedLabel.Visible = true;
+ photoUploadedLabel.Text = "Select a file first.";
+ return;
+ }
+
+ var twitter = new WebConsumer(TwitterConsumer.ServiceDescription, this.TokenManager);
+ XDocument imageResult = TwitterConsumer.UpdateProfileImage(
+ twitter,
+ this.AccessToken,
+ profilePhoto.PostedFile.InputStream,
+ profilePhoto.PostedFile.ContentType);
+ photoUploadedLabel.Visible = true;
+ }
}