Пример #1
0
        private static void ProcessDynamicRegisterRequest(HttpRequest request, HttpResponse response)
        {
            string    blobPath = GetBlobPath(request);
            CloudBlob blob     = StorageSupport.CurrActiveContainer.GetBlobReference(blobPath);

            response.Clear();
            try
            {
                string template  = blob.DownloadText();
                string returnUrl = request.Params["ReturnUrl"];
                TBRegisterContainer registerContainer = GetRegistrationInfo(returnUrl);
                string responseContent = RenderWebSupport.RenderTemplateWithContent(template, registerContainer);
                response.ContentType = blob.Properties.ContentType;
                response.Write(responseContent);
            }
            catch (StorageClientException scEx)
            {
                response.Write(scEx.ToString());
                response.StatusCode = (int)scEx.StatusCode;
            }
            finally
            {
                response.End();
            }
        }
Пример #2
0
        private static void ProcessDynamicRegisterRequest(HttpRequest request, HttpResponse response)
        {
            CloudBlobClient publicClient = new CloudBlobClient("http://theball.blob.core.windows.net/");
            string          blobPath     = GetBlobPath(request);
            CloudBlob       blob         = publicClient.GetBlobReference(blobPath);

            response.Clear();
            try
            {
                string template  = blob.DownloadText();
                string returnUrl = request.Params["ReturnUrl"];
                TBRegisterContainer registerContainer = GetRegistrationInfo(returnUrl, request.Url.DnsSafeHost);
                string responseContent = RenderWebSupport.RenderTemplateWithContent(template, registerContainer);
                response.ContentType = blob.Properties.ContentType;
                response.Write(responseContent);
            } catch (StorageClientException scEx)
            {
                response.Write(scEx.ToString());
                response.StatusCode = (int)scEx.StatusCode;
            } finally
            {
                response.End();
            }
        }
Пример #3
0
        private static TBRegisterContainer GetRegistrationInfo(string returnUrl)
        {
            TBRegisterContainer registerContainer = TBRegisterContainer.CreateWithLoginProviders(returnUrl, title: "Sign in", subtitle: "... or register", absoluteLoginUrl: null);

            return(registerContainer);
        }