Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }