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 7698857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:20:30+00:00 2026-05-31T22:20:30+00:00

I’m trying to create a dialog which will allow users to upload an image.

  • 0

I’m trying to create a dialog which will allow users to upload an image. But I’m having some issues on displaying the dialog.

@{
    ViewBag.Title = "Edit";
}

 @Html.ActionLink("Back", "Index", "Home")


 @using (Html.BeginForm("Update", "Home", new { campaignId = Model.Campaignid }))
 {
    <h1>Current Campaign: @Model.Name</h1><span>(id = @Model.Campaignid)</span>
    <h2>Landing page configurations:</h2><span>(@Model.LandingPage.ToString())</span>
        <div>
            <p>Image:</p>  
            <a href="#" onclick="jQuery('#dialog').dialog('open'); return false">Upload File</a>
        </div>
    <br />
    <input type="submit" value="Save" />
 } 


   <div id="dialog" title="Upload files">        
                @using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
                {
                    <p>
                        <input type="file" id="fileUpload" name="fileUpload" size="23"/>
                        <input type="text" id="name" name="name" />
                        <input type="text" id="alt" name="alt" />
                        <input type="text" id="AlternateText" name="AlternateText" />
                    </p>
                    <br />
                    <p><input type="submit" value="Upload file" /></p>        
                }
   </div>

The issue is that the dialog shows on the html page the HTML.
And when I click on the link the dialog doesn’t pop up.
page

<!DOCTYPE html>

<html>

<head>

    <title>Edit</title>

    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />

    <script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>

    <script src="/Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>

</head>

<body>

     <div class="page">

        <div id="header">

            <div id="title">

                Paycento Loyalty campaign

            </div>



            <div id="menucontainer">

                <ul id="menu">

                    <li><a href="/">Home</a></li>

                     <li><a href="http://www.paycento.com">Paycento</a></li>

                     <li><a href="/Home/About">How it works</a></li>

                     <li><a href="/">Sign up</a></li>                   

                </ul>

            </div>

        </div>

        <div id="main">

           <div class="field-validation-error"> </div>    



 <a href="/">Back</a>

 <script>

 $(document).ready(function() {

    $(function() { $('#uploader').click(function () { $( "#dialog" ).dialog(); }); });

 }

 </script>



<form action="/Home/Update?campaignId=1" method="post">    <h1>Current Campaign: My first campaign</h1><span>(id = 1)</span>

    <h2>Landing page configurations:</h2><span>(1 1)</span>

        <div>

            <p>Image:</p>  

            <a href="#" id="uploader" >Upload File</a>

        </div>

    <hr />

    <h2>Redeem page</h2><span>(2 1)</span>

       <div>



       </div>

    <br />

    <input type="submit" value="Save" />

</form>



   <div id="dialog" title="Upload files">        

<form action="/Home/Upload" enctype="multipart/form-data" method="post">                    <p>

                        <input type="file" id="fileUpload" name="fileUpload" size="23"/>

                        <input type="text" id="name" name="name" />

                        <input type="text" id="alt" name="alt" />

                        <input type="text" id="AlternateText" name="AlternateText" />

                    </p>

                    <br />

                    <p><input type="submit" value="Upload file" /></p>        

</form>   </div>

            <div id="footer">

            </div>

        </div>

    </div>

</body>

</html>
  • 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-31T22:20:31+00:00Added an answer on May 31, 2026 at 10:20 pm

    Try an unobtrusive way:

    1. Give your anchor and id

      <a href="#" id="uploader">Upload File</a>

    2. From jQuery document ready bind click to dialog:

    $(function() {
      $('#uploader').click(function () {
         $( "#dialog" ).dialog();
      });
    });
    
    1. Also make sure you have both jQuery and jQuery UI referenced.

    If this doesn’t help – look into CSS. Maybe you just don’t have the jQuery UI css theme referenced.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to create an if statement in PHP that prevents a single post
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.