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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:21:47+00:00 2026-05-31T05:21:47+00:00

I’m having a brain meltdown since I’m combining Telerik extension with my own jQuery

  • 0

I’m having a brain meltdown since I’m combining Telerik extension with my own jQuery mix-up in my MVC3 project.

I want to be able to call ActionResult with Ajax like this:

    function showDialog(arg) {
    var url = '/Home/ReserveRent/';
    alert(arg);
    $.ajax({
            type: "GET",
            url: url,
            data: { id: arg },
            dataType: "html",
            success: function(data) { $('#RenderRent').html(data); },
            error: function(data) { alert(url+'  '+arg+'   '+data); }
        });
    var rentPayment = $('#RenderRent').html();
    $('#ModalPay' + arg).html(rentPayment);
    $('#Window' + arg).data('tWindow').center().open();
}

On page load I create multiple Telerik Windows which are hidden, I want to call upon each one of them with my jQuery above. My Razor page has these two Div tags included:

    <div>
@foreach (ShowAvailability availability in Model.ShowAvailabilities)
{
    foreach (var salesLine in availability.SalesLinesForSale)
    {
        SalesLine line = salesLine;
        Html.Telerik().Window()
        .Name("Window"+line.SalesLineID)
        .Title("Submit feedback")
        .Content(@<text>
            @using (Html.BeginForm("PayRent", "Payment", FormMethod.Post, new { id = "feedback-form" }))
            {
                <p class="note">This is <strong>salesLine</strong> @line.SalesLineID.</p>

                <div id='"ModalPay"+@line.SalesLineID'>
                    <!--TODO: Here will rendered Html be copied between Divs-->
                </div>
                <div class="form-actions">
                    <button type="submit" class="t-button t-state-default">Submit feedback!</button>
                </div>
            }
            </text>)
        .Buttons(b => b.Close())
        .Width(400)
        .Draggable(true)
        .Modal(true)
        .Visible(false)
        .Render();
    }
}
</div>
<div id="RenderRent" style="display: none;">
    <!-- TODO: Render payment info-->
    @{Html.RenderPartial("ReserveRent");}
</div>

As you can see within my Ajax request I will render the result within the Div tag marked as #RenderRent. I therefore want to replace that Div tag with the special Div tag within the Telerik Window, and the Window now should have the correct model-info within. My controller action is like this:

        public ActionResult ReserveRent(int salesLineId)
    {
        var salesLine = _salesLineLogic.GetSalesLine(salesLineId);

        if (!salesLine.IsAvailable)
        {
            ViewBag.AvailableSalesLine = @"Þessi orlosfeign er því miður ekki lengur til leigu á þessu tímabili.";
            return RedirectToAction("Index", "Home");
        }

        salesLine.IsAvailable = false;
        _salesLineLogic.SaveToDatabase();

        var payment = new Payment { FK_SalesLineID = salesLineId, EditedBy = "PayRent.cshtml (GET)", EditedOn = DateTime.Now };

        return PartialView(new HomeFormViewModel(payment));
    }

For some reason the argument is not being received from the Ajax request, the salesLineId is always NULL. Can anyone spot what I’m doing wrong with the AjaxRequest, or if the jQuery function is not declared right?

  • 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-31T05:21:48+00:00Added an answer on May 31, 2026 at 5:21 am

    Your ajax call has incorrect data. Property inside your object literal (id) doesn’t match to the salesLineId in the controller action.

    $.ajax({
        type: "GET",
        url: url,
        data: { salesLineId: arg },
        dataType: "html",
        success: function(data) { $('#RenderRent').html(data); },
        error: function(data) { alert(url+'  '+arg+'   '+data); }
    });
    

    Update

    There is also something weird on this line

    <div id='"ModalPay"+@line.SalesLineID'>
    

    It should be something like

    <div id='ModalPay@(line.SalesLineID)' >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
i want to parse a xhtml file and display in UITableView. what is the

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.