Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-06-26
1
Medium Priority
?
294 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 1500 total points
ID: 39280139
Use ajax file uploader I don't think you need submit button. Google for "ajax file uploader"
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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

963 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