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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:13:01+00:00 2026-06-09T18:13:01+00:00

I have an image inside a partial view that will ultimately be changed by

  • 0

I have an image inside a partial view that will ultimately be changed by various controls in the view. Courtesy of MS Chart Controls this means I need to create a new image each time I change one of the settings. For now I simply want to remove the said image from the page on change of a drop down property (later on I plan to call the action which draws the chart with different parameters), however this does not seem to be working.

Inside my partial view:

<!--I populate the dropdown from a model loaded from a database-->
<select id="scoresSelect">
    @foreach(var option in @Model.testlist)
    {
      <option value="@option">@option</option>
    }
</select>

<div style="clear:both">&nbsp</div>

<img id="statusgraph" src="@Url.Action("StatusGraph", new { title=@Model.Options.First().Value.First()})"/>

 <p>Bottom controls</p>


<!--Downside of using partial views: scripts cannot be externally loaded-->
<script type="text/javascript">

$(document).ready(function () {

    $("#scoresSelect").change(function () {
        alert("changed");   // this executes just fine
        $("#graphid").prop({display: "none"});
    });



});


</script>

The alert method executes just fine and so I know it isn’t a javascript problem. Does anyone know why it breaks and how to make this work?

Thanks!

  • 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-06-09T18:13:02+00:00Added an answer on June 9, 2026 at 6:13 pm

    Use $("#graphid").css({display: "none"}); instead of $("#graphid").prop({display: "none"});

    .prop() method gets the property value for only the first element in the matched set.

    While The .css() method is a convenient way to get a style property from the first matched element.

    NOTE: display is the property in css.

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

Sidebar

Related Questions

Scenario: I have a View and inside that view I also a partial view.
I have an image inside a div tag so that on clicking this image,
I have an image inside a div like this <div><img /><div> The image is
Is it possible to have image backgrounds inside HTML e-mails that are displayed across
Currently I have an image inside of a frame in my view. I would
I have an Image icon inside a StackPanel that's inside a ListBox and I
I have an image inside a div. I want that image to be draggable
I have an Image inside a Canvas : <Canvas> <Image HorizontalAlignment=Center VerticalAlignment=Center /> </Canvas>
I have an image inside a div.. the div has a background picture..and I
I have an Image inside UIScrollView which i can zoom in and out. I

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.