Solved

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

Posted on 2013-06-26
1
283 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now