Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3456916
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:47:46+00:00 2026-05-18T09:47:46+00:00

I’m building an application that will shutdown a server, ping that server, and notify

  • 0

I’m building an application that will shutdown a server, ping that server, and notify the user if the server has been shutdown. If it does not shutdown successfully, it allows the user to “Try Again”. I can get the application to process the logic correctly the first time but when I implement the “Try Again” feature, it does not reprocess the Shutdown action. I think it must have something to do with caching but I don’t know enough about it to know where to start looking. Any ideas?

Here is my code:

Controller

    //URL: Build/Progress  
    public ActionResult Progress()  
    {  
        return View();  
    }  

////URL: Build/MoveDevice  
public ActionResult ShutdownStatus()  
{  
    ImageInfo ImageInfo = new ImageInfo();  
    FarmInfo FarmInfo = new FarmInfo();  
    ProgressModel ProgressModel = new ProgressModel();  

    if ((Session["ShutdownStatus"] as string) == "Success")  
    {  
        ProgressModel.ShutdownStatus = 1;  
        return View(ProgressModel);  
    }  
    else  
    {  
        ImageInfo = svcImage.GetImageInfoByImageId(Session["ImageName"].ToString());  
        string Farm = ImageInfo.FarmId.ToString();  
        FarmInfo = svcFarm.GetFarmByFarmId(Farm);  
        svcImageSvc.ShutdownDevice(Session["Username"].ToString(), Session["Password"].ToString(), Session["Domain"].ToString(),  
            FarmInfo.farmName, ImageInfo.Device, ImageInfo.ImageHistory.Status, ImageInfo.PVSHost, ImageInfo.PVSAccount);  

        ProgressModel.ShutdownStatus = svcImageSvc.PingDevice(ImageInfo.Device);  
        return View(ProgressModel);  
    }  
}

Views (Progress.aspx)

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>  

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">  
    Progress  
</asp:Content>  

<asp:Content ID="Content5" ContentPlaceHolderID="HeadContent" runat="server">  

</asp:Content>  

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">  
    <h1>Progress</h1>  
    <hr />  

    <!-- Shutdown Status -->  
    <div class="panel" id="panel1"><img src="../../Assets/Images/load.gif" /></div>  
    <script type="text/javascript">  
        $.get('<%= Url.Action("ShutdownStatus", "Build", null) %>',  
        function (data) {  
            $('#panel1').replaceWith(data);  
        });  
    </script>  

</asp:Content>  

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">  
</asp:Content>  

<asp:Content ID="Content4" ContentPlaceHolderID="FooterContent" runat="server">  
</asp:Content>

View (ShutdownStatus.asxc)

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PvsUtil.App.Core.Models.ProgressModel>" %>  

    <% using (Html.BeginForm())  
       { %>  
        <% if (Model.ShutdownStatus == 1)  
           { %>  
           <%: Session["ShutdownStatus"] = "Success" %>  
            <p>  
                Server shutdown succesfully  
            </p>  
            <% } %>  

        <% if (Model.ShutdownStatus == 2)  
            { %>  
            <p>Server did not shutdown within 1 minute.  Please check the server and try again.</p>  
            <%: Html.ActionLink("Try Again", "Progress", "Build") %>  
            <% } %>  

        <% if (Model.ShutdownStatus == 3)  
        { %>  
        <p>An error has occurred.  Please check the server and try again.</p>  
        <%: Html.ActionLink("Try Again", "Progress", "Build") %>  
        <% } %>  
     <% } %>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:47:47+00:00Added an answer on May 18, 2026 at 9:47 am

    I believe the caching is actually being done by jQuery. Change the $.get to a $.post and see if it works. If it does, you can still use $.get, but you will need to set the option:

    cache: false
    

    HTH,
    Brian

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.