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

[Solved] Telerik MVC2 Window Problem

1 Answer 124 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gonzalo
Top achievements
Rank 1
Gonzalo asked on 15 Dec 2010, 10:07 PM
Hi there,

well my first post, and is a cuestion (the usuall i supouse)

I'm having a little trouble to get centered a telerik window...
for some reason, the "center()" method is not available to call it.

it was tested with the demo page in IE and the method is there, but when im trying to put the same code on my application, just dont appears....

attached are a couple of pics to make more graphical

this happens on IE(7) - cause Chrome does what i want.
can anybody tell me why is this happen????

This is my master page:
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage"  %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head runat="server">
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
     <%        
         Html.Telerik()
                .StyleSheetRegistrar()
                .DefaultGroup(group => group
                .Add("telerik.common.min.css")
                .Add("telerik.simple.min.css")
                .Add("telerik.rtl.min.css")
                .Add("main.css"))
                .Render();
     %>
</head>
  
<body>
   <!-- Inicio Div Principal -->
    <div id="global">
    <!-- Información Ejecutivo -->
            <p class="ejecutivo">
            <%: Html.Label("Ejecutivo:") %>
            <%: Html.Label("Rodrigo Contreras") %>
            <%= Html.ActionLinkImage("Salir", "Salir", HelpersAMS.TipoLink.dinero) %>
            </p>
            <div class="navigation">
              
                <ul class="tabs" id="main-nav">              
                    <li><%: Html.ActionLink("Bitácora", "Index", "Home")%></li>
                    <li><%: Html.ActionLink("Modulos Comunes", "About", "Home")%></li>
                    <li><%: Html.ActionLink("TestWindow", "TestWindow", "Home")%></li>
                </ul>
              
            </div>
        <!-- Inicio Div Main -->
        <div id="main">
        <!-- Inicio Contenido Principal -->
            <asp:ContentPlaceHolder ID="MainContent" runat="server">
          
            </asp:ContentPlaceHolder>
             
        </div>
         <div id="footer">
                <div class="site-id">
                    <img src="../../Content/Images/logo-banco.gif" alt="Logo Banco Security"/>
                </div>
            </div>
    </div>
<%= Html.Telerik().ScriptRegistrar() %>
  
     
</body>
</html>

My View:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Principal.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   <style type="text/css">
        .example form
        {
            width: 430px;
            height: 370px;
            float: right;
        }
          
        #undo
        {
            text-align: center;
            position: absolute;
            white-space: nowrap;
            border-width: 1px;
            border-style: solid;
            padding: 2em;
            cursor: pointer;
        }
    </style>
    TestWindow
</asp:Content>
  
 <asp:content ID="Content2" contentPlaceHolderID="MainContent" runat="server">
  
    <% Html.Telerik().Window()
           .Name("Window")
           .Title("Telerik Window for ASP.NET MVC")
           .Draggable(true)
           .Resizable(resizing => resizing
               .Enabled(true)
               .MinHeight(250)
               .MinWidth(250)
               .MaxHeight(500)
               .MaxWidth(500)
            )
           .Modal(false)
           .Buttons(b => b.Maximize().Close())
           .Content(() =>
           {%>
                <p style="text-align: center">
                    <img src="<%= Url.Content("~/Content/Window/window.png")%>"
                         alt="Window for ASP.NET MVC logo" style="display:block;margin:0 auto
                             10px;" />
                              
                    The Telerik Window for ASP.NET MVC is<br /> the right choice for creating Window
                        dialogs<br />
                    and alert/prompt/confirm boxes<br /> in your ASP.NET MVC applications.
                </p>
           <%})
           .Width(300)
           .Height(300)
           .Render();
    %>
      
    <% Html.Telerik().ScriptRegistrar()
           .OnDocumentReady(() => {%>
                var lovelyWindow = $('#Window');
                var undoButton = $('#undo');
                undoButton
                    .bind('click', function(e) {
                        lovelyWindow.data('tWindow').center().open();
                        undoButton.hide();
                    })
                    .toggle(!lovelyWindow.is(':visible'));
                  
                lovelyWindow.bind('close', function() {
                    undoButton.show();
                });
           <%}); %>
             
    <span id="undo" class="t-group">Click here to open the window.</span>
  
</asp:content>


thanks in advance...

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 16 Dec 2010, 10:02 AM
Hello Gonzalo,

Before anything else, nesting the <style> tag in the <title> tag renders quite the invalid HTML. If you take a look at the master page in the online demos, we have a different ContentPlaceHolder section for placing HTML in the <head> tag (after the StyleSheetRegistrar). Please update your solution and if the problem persists, send a working sample project that shows the problem.

Greetings,
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
General Discussions
Asked by
Gonzalo
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or