This is a migrated thread and some comments may be shown as answers.
Window dynamic content via jquery?
1 Answer 132 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kyle Pike
Top achievements
Rank 1
Kyle Pike asked on 11 Aug 2010, 05:15 PM
Hi,

I'm trying to add a window to my project.

the window will only display when a button is clicked
i need to pass a value (a search term) to the Controller Action when it is created.

I see how to create the window using server tags, and how to set its load action

but how can i change the route values in the action - or set a fully formed url for the window to load - via the javascript methods?

i don't have to use Jquery, i just need a pop-up search just like we used in classic ASP.NET AJAX to be functional.

please advise.
thank you.

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 12 Aug 2010, 09:51 AM
Hello Kyle,

First, you should serialize your search URL from the server like this:

var searchUrl = unescape('<%= Url.Action("Search", "Home", new { query = "{0}" }) %>');

Then, you can request the URL through the window client-side API like this:

$('#MyLovelyWindow').data('tWindow')
    .ajaxRequest($.telerik.formatString(searchUrl, "telerik"))
;

(the "{0}" in the search URL will be replaced by "telerik", like in String.Format).

All the best,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Kyle Pike
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or