This is a migrated thread and some comments may be shown as answers.

[Solved] Only one instance of Window per page

2 Answers 132 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Philip Fourie
Top achievements
Rank 1
Philip Fourie asked on 15 Mar 2011, 06:19 PM
I have an EditorTemplate that is repeated on a page. This EditorTemplate creates a Telerik Window (see code below).  How do I ensure that only one instance of the 'PostalLookupWindow` Window is created for a given page/request?

I have tried using ViewData and TempData to store temporary values indicating that the control has been created before but was unsuccessful.  I cannot put the Window creation in the controls's parent as the EditorTemplate is re-used in multiple pages.

 Html.Telerik().Window()
    .Name("PostalLookupWindow")
    .Title("Postal Code Selection")
    .Height(430)
    .Width(700)
    .Modal(true)
    .Draggable(true)
    .Scrollable(false)
    .LoadContentFrom(Url.Action("Index","PostalCode"new { area = "" }, Request.Url.Scheme))
    .Visible(false).Render();

I am using:
  • Telerik MVC extensions 2010.3.1318
  • ASP.NET MVC 3.0
    I am using 2010.3.1318
    I am using 2010.3.1318

Thank you,
Philip Fourie

2 Answers, 1 is accepted

Sort by
0
Philip Fourie
Top achievements
Rank 1
answered on 15 Mar 2011, 07:02 PM
I cross-posted on StackOverflow and found a solution that will work. 
0
nachid
Top achievements
Rank 1
answered on 17 Mar 2011, 07:46 AM
I am creating it on my master page and using this unique Window instance everywhere in my application.
Tags
Window
Asked by
Philip Fourie
Top achievements
Rank 1
Answers by
Philip Fourie
Top achievements
Rank 1
nachid
Top achievements
Rank 1
Share this question
or