Solved

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

Posted on 2013-06-26
1
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Suggested Courses

739 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