summaryrefslogtreecommitdiffstats
path: root/samples/Consumer/SampleWcf.aspx.cs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/Consumer/SampleWcf.aspx.cs')
-rw-r--r--samples/Consumer/SampleWcf.aspx.cs7
1 files changed, 4 insertions, 3 deletions
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) {