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

  • SEARCH
  • Home
  • 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 6781033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:34:35+00:00 2026-05-26T16:34:35+00:00

I am beginner in MVC3 and still learning. I try to write an application

  • 0

I am beginner in MVC3 and still learning. I try to write an application (MVC3 with Razor) which allows user to select files and upload/save. During upload/save process I want to simply show “wait” text as partial view. I have problem since the partial view is loaded as soon as the web application is started and I got error from HomeController – [HTtpPost] Wait method, since it can’t trace the list Files in object job. OF course, the list of Files will be filled after upload. I don’t know how to solve this and need your help. Thank you in advance.

My HomeController.cs :

    public ActionResult Index()
    {
        return View();
    }

    [HttpPost]
    public ActionResult UploadFile(IEnumerable<HttpPostedFileBase> attachments)
    {
        foreach ( var file in attachments )
        {
            // do something
        }
        return RedirectToAction("Wait");
    }

    public ActionResult Wait()
    {
            // do something
            ViewBag.Message = "Wait...";
            return View();
    }

    [HttpPost]
    public ActionResult Wait(FormCollection formCollection)
    {
        Work job = MvcApplication.GetWork();
        if ( job.Files.Any() )
        {
            return RedirectToAction("SubmitWork");
        }
        else
        {
            return View();
        }
    }

The view Index.cshtml :

@{
ViewBag.Title = "FirstTry";
}
<p>
<div id="AddFiles">
    @Html.Partial("_AddFiles")
</div>
</p>

<div id ="Wait">
    @Html.Partial("_Wait")
</div>

The partial view _Wait.cshtml :

@{
ViewBag.Title = "Wait...";
}
@ViewBag.Message
@using ( Html.BeginForm("Wait", "Home", FormMethod.Post, new
{
    id = "waitform"
}) )
{
}
<script type="text/javascript">
    window.setTimeout("document.getElementById('waitform').submit()", 1000); 
</script>

The partial view _AddFiles.cshtml :

@using ( Html.BeginForm("UploadFile", "Home", FormMethod.Post, new{id = "uploadForm", enctype = "multipart/form-data"}) ) 
{
    @(Html.Telerik().Upload().Name("attachments").Multiple(true)
        .Async(async => async.AutoUpload(true) )
    )

    <input type="submit" value="Send" class="t-button" />
    <input type="reset" value="Reset" class="t-button" />
}
  • 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-26T16:34:36+00:00Added an answer on May 26, 2026 at 4:34 pm

    MVC does not work like WebForms, client side events will not propagate to server controls (there aren’t really even controls, I think Telerik blurs this line a bit and complicates the MVC experience).

    You can invoke additional actions in your controller to download HTML or JSON or something, but the only way on the client side to swap HTML without having your page change (since an upload is in progress) would be to use javascript.

    I’m not familiar with this Telerik control, but I think you will have to do something on the client side, not on the server side, to indicate loading progress or show a spinner.

    Their API shows there is an onupload event you can listen for and possible swap to the loading div:

    http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-upload-client-api-and-events.html

    They probably have a sample somewhere. I will see if I can dig something up, but really I think just listening for this event is your best bet and do this on the client side, not the server side.

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

Sidebar

Related Questions

I am beginner in MVC3 and building one application, i need to make confirmation
I am building wizard step demo application with MVC3 and using razor view engine
Beginner help needed :) I am doign an example form a php book which
SQL beginner here. I have a query which takes around 10 seconds to run,
Beginner to assembly programming for x86. I have a simple asm file which I
Beginner android question. Ok, I've successfully written files. E.g. // get the file name
iOS beginner here. I'm using the following code to save my facebook accessToken and
I am trying deploy my asp.net mvc3 application, here it is what i done
Complete beginner to Rails here: In Rails: I have a Model Post, which hasmany
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later

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.