Search code examples
.netajaxmodel-view-controller

Showing the newly opened window in smaller size like a popup


I have code to redirect to another page in ASP.NET MVC using an Ajax call. Below is the code which I am using for that purpose. But by using that code I am able to redirect to another page in full size. But I want to open the new page in a smaller size like a popup. Can someone please let me know what change need to be done?

onClick: function (e) 
{
    $.ajax
        ({
            type: "GET",
            url: "/Home1/UploadFile", 
            data: { key: selectedKey },
            success: function (result) 
            {
                window.location.href = '@Url.Action("UploadFile", "Home1")';
            },
            error: function (req, status, error) 
            {
                alert('error');
            }
        });
}

Solution

  • Have a look at this thread.

    I think you can apply the approach to yours.

    onclick open window and specific size