I have a modal window that is initially displayed with a ViewUserControl in its content. In fact this is a classic Logon Control asking for user and password. The User Control is like this:
<%
@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<% Html.Telerik().Window()
.Name(
"logonWindow")
.Title(
"xxx - 1.0")
.Icon(Url.Content(
"~/Content/img/16/toolbox.png"), "toolbox")
.Draggable(
true)
.Scrollable(
false)
.Resizable()
.Modal(
true)
.Visible(
false)
.Content(()=>
{
%>
<%
using( Html.BeginForm( "LogOn", "User" ) ) { %>
<table id="tableDialog">
<tr height="25">
<td align="right" class="ui-widget">
User:
</td>
<td class="ui-widget">
<%
= Html.TextBox( "txtUser" ) %>
</td>
</tr>
<tr height="25">
<td align="right" class="ui-widget">
Password:
</td>
<td class="ui-widget-input">
<%
= Html.Password( "txtPassword" )%>
</td>
</tr>
<tr id="trSeparator1" style="height: 5px"></tr>
<tr id="trFirstTimeMessage" height="25">
<td class="ui-widget" colspan="2">
This is your firsta access.
<br />
Please change your Password.
</td>
</tr>
<tr id="trSeparator2" style="height: 5px"></tr>
<tr id="trNewPassword" height="25">
<td align="right" class="ui-widget">
New
<br />Password:
</td>
<td style="font-size: 11px">
<%
= Html.Password( "txtNewPassword" )%>
</td>
</tr>
<tr id="trConfirPassword" height="25">
<td align="right" class="ui-widget">
Confirm your
<br />Password:
</td>
<td class="ui-widget">
<%
= Html.Password( "txtConfirmPassword" )%>
</td>
</tr>
<tr height="20">
<td colspan="2" align=right>
<div id="submitButton" width="100%">
<span id="divBtnLogOn"><input id="btnLogon" type="submit" value="LogOn" class="t-button" /></span>
<span><img id="loadingPanel" alt="running" class="t-loading" style="display: none" /></span>
</div>
</td>
</tr>
<t>
<td colspan="2">
<div id="logMsg" class="errorMsg" />
</td>
</tr>
</table>
<% } %>
<%
})
.Render();
%>
Some input fields were initially hidden using jQuery. Like this:
var
jqWindow = jQuery('#logonWindow');
jQuery(
'#trSeparator1').hide();
jQuery(
'#trMensagemPrimeiraVez').hide();
jQuery(
'#trSeparator2').hide();
jQuery(
'#trNovaPassword').hide();
jQuery(
'#trConfirmePassword').hide();
The window is displayed initially OK. The window assumes width and height correctly and only User and Password area displayed.
The hidden fields must be displayed if some conditions occur. I Simply show the input fields like this:
var
jqWindow = jQuery('#logonWindow');
jQuery('#trSeparator1').show();
jQuery(
'#trMensagemPrimeiraVez').show();
jQuery(
'#trSeparator2').show();
jQuery(
'#trNovaPassword').show();
jQuery(
'#trConfirmePassword').show();
When I execute these commands I expected the window to automatically extend it's height to show them. But this does not occur.
Then I tried to force a new height before the commands to show the fields like this:
var jqWindow = jQuery('#logonWindow');
jqWindow.height(
'300');
When I do this the window height is really extended but the area where the fields should be displayed remains blank. Its like there were no fields there. The window hieght is extended but the fields were not displayed.
What must I do ???
Thanks in advance