Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Css issue on scroll 1 18
gif banner animation loads randomly in mobile 3 31
Calling stored proc in EDMX 11 18
ajax form sumbit 3 22
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.
This article discusses how to create an extensible mechanism for linked drop downs.
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…

708 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

16 Experts available now in Live!

Get 1:1 Help Now