Solved

mvc3: how to handle two buttons that perform a post back on a page

Posted on 2013-06-26
1
286 Views
Last Modified: 2013-07-08
please Take a look at the attached screen shot.
I have two buttons. A browse button and submit button.
When I click on browse it picks the path to a file I want to process.

My target is to click the submit button to run the process but when I do this,  the page
re post again and the content of my path is lost.

I am new to mvc. How can i handle this so that on the click of submit button the path
to my file will not be lost and I can still execute a method in my controller.


[HttpPost]
        public ActionResult Index(HttpPostedFileBase file)
        {
            // do something
            return View();
        }

public void ProcessMyStuffHere()
        {
             //do something  
        }

Thanks.
Demo.PNG
0
Comment
Question by:Sirdots
1 Comment
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 39280139
Use ajax file uploader I don't think you need submit button. Google for "ajax file uploader"
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question