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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:53:35+00:00 2026-06-14T20:53:35+00:00

I hope you can assist me with one dillema. I´m going to write a

  • 0

I hope you can assist me with one dillema. I´m going to write a bunch of code before I ask my question below 🙂

When something is clicked on my page:

<input type='button' value='1' name='derp1' onclick='OpenTelerikWindow(1)' />
<br/>
<input type='button' value='2' name='derp2' onclick='OpenTelerikWindow(2)' />

I open Telerik Window with Jquery:

function OpenTelerikWindow(arg) {
var url = '/Controller/Derp/';
$.ajax({
    type: "GET",
    url: url,
    dataType: "html",
    data: { id: arg }
    success: function (data) {
        $('#PaymentWindow').data("tWindow").content(data);
        $('#PaymentWindow').data("tWindow").center().open().refresh();
    }
  });
}

My Controller ActionResult:

public ActionResult Derp(int id)
{
    SomeModel someModel = _GetModel(id);
    return PartialView("Derp", someModel)
}

And then the content of my Telerik Window goes something like this:

@SomeModel
<div id="theDerpina">
    <div>
        //Some Stuff
        @using (Ajax.BeginForm("Derpina1", "Controller", new { id = SomeModel.id }, new AjaxOptions
            {
                HttpMethod = "POST",
                UpdateTargetId = "theDerpina",
                InsertionMode = InsertionMode.Replace
            }, new { id = "feedback-form" }))
        {
            //Some Stuff
            <button type="submit" > Submit</button>
            <br/>
            <button type="button" > CloseWindow </button>
        }
    </div>
    <div>
        //More Stuff
        @using (Ajax.BeginForm("Derpina2", "Controller", new { id = SomeModel.id }, new AjaxOptions
            {
                HttpMethod = "POST",
                UpdateTargetId = "theDerpina",
                InsertionMode = InsertionMode.Replace
            }, new { id = "feedback-form" }))
        {
            //Different Stuff
            <button type="submit" > Submit</button>
            <br/>
            <button type="button" > CloseWindow </button>
        }
    </div>
</div>

My two other Controller Actions:

public ActionResult Derpina1(int id)
{
    SomeModel someModel = _GetModel(id);
    if(ModelState.IsValid)
    {
        //DoStuff
        return View("SomeOtherView");
    }
    else
    {
        return PartialView("Derp", someModel);
    }
}

public ActionResult Derpina2(int id)
{
    SomeModel someModel = _GetModel(id);
    if(ModelState.IsValid)
    {
        //DoDifferentStuff
        return View("SomeOtherView");
    }
    else
    {
        return PartialView("Derp", someModel);
    }
}

When I open the Window once, everything works fine. However if I were to open the Window, close it, and then open it again then weird things happen. Let´s say for instance that I clicked the submit button for Derpina1, I would receive two calls to that particular Controller action. If I monitor the console in Firebug I see two separate calls to my controller action. Then the same thing would happen if I would close the Window one more time, open it again, and submit again, my controller action would now receive 4 calls to my controller action.

Perhaps you guys can point to the right direction. Should I open the Telerik Window in a different way, also should I use different method to return ModelError were that to happen? (because I´m faced with the same behaviour if I get a ModelError)

  • 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-14T20:53:37+00:00Added an answer on June 14, 2026 at 8:53 pm

    I managed to find out the solution after googling a while. All I did was creating a Window on the fly from within the script, and then destroying it after I have used it, like so:

    function OpenTelerikWindow(arg) {
    var url = '/Controller/Derp/';
    $.ajax({
        type: "GET",
        url: url,
        dataType: "html",
        data: { id: arg }
        success: function (data) {
            var paymentWindow = $("<div id='PaymentWindow'></div>").tWindow({
                title: "Payment",
                contentUrl: '',
                html: data,
                modal: true,
                resizable: false,
                draggable: true,
                width: 500,
                height: 640,
                onClose: function (e) {
                    e.preventDefault();
                    paymentWindow.data('tWindow').destroy();
                }
            });
            paymentWindow.data('tWindow').center().open();
        }
      });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really hope some SQL guru out there can assist with this one (and
Hope someone can assist with a (simple) async question on node-redis. I'm trying to
hope someone can answer this. Here is some sample code. namespace std { #ifdef
Hope someone can assist with this, it's driving me crazy. I have a class
This is kind of a simple question that I hope can be answered easily,
I hope someone can assist me with the problem I'm currently experiencing. We have
I hope someone can assist please. I have a Fragment hosting multiple list fragments
I hope somebody can assist in pointing out my ignorance by solving this problem...
I hope someone can assist me please. I am using a pullout widget in
I hope someone can lend an assist and some advise here. I'm trying to

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.