brothers28 brothers28 - 1 year ago 81
jQuery Question

Data won't be load in div

I have a problem in one of my ASP.NET MVC views.

When the page is loaded, I Render an

inside a

<div id="#jobs">
Html.RenderAction("Jobs", "Home", new { enviroment = "value" });

My action
, looks like that (It's very simple):

public ActionResult Jobs(string enviroment)
var model = new MyModel();
model.Jobs = //Get Jobs...
return PartialView(model);

My Partial View just contains a table with all

Then I have a HTML.DropDownList, wich contains my enviroments.
When this DropDownList changes it fires a JavaScipt function wich should update my Table inside my
Jobs div

The function looks like that:

function updateJobs() {
var selectedEnviroment = $("#enviromentsDropdown").val();

type: "GET",
url: '@Url.Action("Jobs", "Home")',
data: {'enviroment': selectedEnviroment},
dataType: "html",
success: function (data) {

The function is working perfectly and
contains everything I want to have, but it's not updating my
Jobs <div>

If I instead put my data in another
it works without any problems.

Do you guys have any idea what I'm doing wrong and why it doesn't want to update my
Jobs div

Answer Source

Change <div id="#jobs"> to <div id="jobs">

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download