Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4028912
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:16:46+00:00 2026-05-20T11:16:46+00:00

I have a form in which user inputs its data along with its image.

  • 0

I have a form in which user inputs its data along with its image. This form will be in a jquery dialog. I want to know if its is possible that if I upload an image and then send it to server for saving on hard drive after that without loosing that dialog print a message your file uploaded. If yes then how i can use jquery ajaxform plugin. Im using asp.net mvc.

What i have tried is as follows

My View

<div id="dialog" title="Dialog Title" style="display: none">
        <div id="Jobs">
        <form id="frmupload" enctype="multipart/form-data" method="post">
            <input id="File1" type="file" name="file" />
            <input id="Button1" type="submit" value="Upload" name="button" /> 
            </form>
        </div>
    </div>

My JQuery

function dialogs(id) {
        $(function () {
            var ph = $("#Jobs");           
                ph.dialog({
                    width: 700,
                    modal: true,
                    show: 'slide',
                    closeText: 'hide',
                    draggable: false,
                    resizable: false
                });
            //});
        });
    }

    function clik(id) {
        dialogs(id);
        return false;
    }
 var options = {
            url: "/Post/UploadImages"            
        };       

        $('#frmupload').ajaxForm(function (options) {
            //alert(data);
            alert("Thank you for your comment!");
        });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:16:47+00:00Added an answer on May 20, 2026 at 11:16 am

    Check out the following example that uses an AJAX file upload (unfortunately, it looks like the JavaScript isn’t given):

    http://jquery.malsup.com/form/#file-upload

    Basically, you need to include the iframe property in your options object:

    var options = {
        url: "/Post/UploadImages",
        iframe: true
    }; 
    

    The catch is that the plugin expects a response wrapped in <textarea></textarea> tags (because the response type must be HTML or XML). You can do this conveniently by introducing your own type of response for handling an AJAX file upload, as outlined in the blog post here:

    public class FileUploadJsonResult : JsonResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            this.ContentType = "text/html";
            context.HttpContext.Response.Write("<textarea>");
            base.ExecuteResult(context);
            context.HttpContext.Response.Write("</textarea>");
        }
    }
    

    And then in your controller action:

    return new FileUploadJsonResult { Data = new { /* ... */ } };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which takes both the user details and an image uploaded
I have a form in which people will be entering dollar values. Possible inputs:
i have a form in which if the user enters the search query, its
I have a form in which the user can choose a component type from
I have an ASP.NET web form which I am adding a variable number User
I have a C# form into which I've placed a left-docked MenuStrip . This
So I have a normal form with 1 textarea and two hidden inputs, which
I have a form which is used to insert/display and update . In the
I have a form which has a lot of SELECTs. For various reasons, I'd
In my Rails app, I have a form which redirects through a foreign service,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.