diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-10-05 08:17:04 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-10-05 08:17:04 -0700 |
commit | e05932831b940199cba4edab68d383dcfdedfd9c (patch) | |
tree | 2a6084399b4234dd7da239c4d0d8f5c78fb50b31 | |
parent | 3278e2098c375383ca9a1dd06f7340bd69cc1e60 (diff) | |
download | DotNetOpenAuth-e05932831b940199cba4edab68d383dcfdedfd9c.zip DotNetOpenAuth-e05932831b940199cba4edab68d383dcfdedfd9c.tar.gz DotNetOpenAuth-e05932831b940199cba4edab68d383dcfdedfd9c.tar.bz2 |
Slightly improved UI on WCF Consumer sample.
-rw-r--r-- | samples/Consumer/SampleWcf.aspx | 14 | ||||
-rw-r--r-- | samples/Consumer/SampleWcf.aspx.cs | 7 |
2 files changed, 10 insertions, 11 deletions
diff --git a/samples/Consumer/SampleWcf.aspx b/samples/Consumer/SampleWcf.aspx index 604be81..aad8a88 100644 --- a/samples/Consumer/SampleWcf.aspx +++ b/samples/Consumer/SampleWcf.aspx @@ -2,14 +2,12 @@ CodeFile="SampleWcf.aspx.cs" Inherits="SampleWcf" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
-
- <asp:Button ID="getAuthorizationButton" runat="server" Text="Get Authorization"
- onclick="getAuthorizationButton_Click" />
+ <asp:Button ID="getAuthorizationButton" runat="server" Text="Get Authorization" OnClick="getAuthorizationButton_Click" />
+ <asp:Label ID="authorizationLabel" runat="server" />
<br />
- <asp:Button ID="getNameButton" runat="server" Text="Get Name"
- onclick="getNameButton_Click" />
+ <asp:Button ID="getNameButton" runat="server" Text="Get Name" OnClick="getNameButton_Click" />
+ <asp:Label ID="nameLabel" runat="server" />
<br />
- <asp:Button ID="getAgeButton" runat="server" Text="Get Age"
- onclick="getAgeButton_Click" />
-
+ <asp:Button ID="getAgeButton" runat="server" Text="Get Age" OnClick="getAgeButton_Click" />
+ <asp:Label ID="ageLabel" runat="server" />
</asp:Content>
diff --git a/samples/Consumer/SampleWcf.aspx.cs b/samples/Consumer/SampleWcf.aspx.cs index a6cdc8f..1e03669 100644 --- a/samples/Consumer/SampleWcf.aspx.cs +++ b/samples/Consumer/SampleWcf.aspx.cs @@ -1,4 +1,5 @@ using System;
+using System.Globalization;
using System.Net;
using System.ServiceModel;
using System.ServiceModel.Channels;
@@ -18,6 +19,7 @@ public partial class SampleWcf : System.Web.UI.Page { var accessTokenMessage = consumer.ProcessUserAuthorization();
if (accessTokenMessage != null) {
Session["WcfAccessToken"] = accessTokenMessage.AccessToken;
+ authorizationLabel.Text = "Authorized! Access token: " + accessTokenMessage.AccessToken;
}
}
}
@@ -29,13 +31,12 @@ public partial class SampleWcf : System.Web.UI.Page { }
protected void getNameButton_Click(object sender, EventArgs e) {
- string name = CallService(client => client.GetName());
- Response.Write(name);
+ nameLabel.Text = CallService(client => client.GetName());
}
protected void getAgeButton_Click(object sender, EventArgs e) {
int age = CallService(client => client.GetAge());
- Response.Write(age);
+ ageLabel.Text = age.ToString(CultureInfo.CurrentCulture);
}
private T CallService<T>(Func<DataApiClient, T> predicate) {
|