MainPage.ASPX:
<head runat="server">
<script type="text/javascript">
function LoadComp(lid){
try {
mainPanel.LoadThisComp(lid);
}catch(err){
alert("Please wait for the adjustments screen to finsh loading");
return false;
}
}
</script>
</head>
... body tag and some other tables ...
<table id="tblLayout" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="100%">
<td width="215" valign="top" style="width: 215px; height: 100%; background-color: White;" class="SplitterPane" align="center">
<table border="0" id="tComparables" width="215" height="100%" style="height: 100%; overflow: scroll;">
<tr height="25"><td class="TopItem">Comparables List</td></tr>
<tr id="trComparables">
<td valign="top">
<asp:ScriptManager ID="sM" runat="server" EnablePartialRendering="true" />
<asp:UpdatePanel ID="uP" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="CompListHolder" runat="server" EnableViewState="False">
<fluent:ListTransfer ID="lOrder" runat="server" ListControlTo="lComparables" ListControlFrom="lbHide"
EnableClientSide="True" AllowDuplicates="False" />
<asp:ListBox ID="lComparables" runat="server" Width="215px" Height="100%" EnableViewState="False"
onchange="LoadComp(this.options[selectedIndex].value)" />
<asp:ListBox ID="lbHide" runat="server" Height="0px" Width="0px" Visible="False" EnableViewState="False" />
</asp:PlaceHolder>
<asp:HiddenField ID="hAddListing" runat="server" />
<asp:HiddenField ID="hDelListing" runat="server" />
<asp:Button ID="bAddListing" runat="server" Text="" style="display:none;" OnClick="bAddListing_Click" />
<asp:Button ID="bDelListing" runat="server" Text="" style="display:none;" OnClick="bDelListing_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</td>
<td class="HorizontalSplitterBar" style="width: 5px; vertical-align: middle; text-align: center;">
<div style="height: 1px; width: 5px"></div>
</td>
<td width="100%" class="DetailsPane" valign="top" style="height: 100%;">
<div style="width: 100%; height: 100%; overflow: auto;">
<iframe id="mainPanel" name="mainPanel" frameborder="0" width="100%" height="100%" scrolling="auto" src=""></iframe>
</div>
</td>
</tr>
</table>
The page for the IFrame (Page2.ASPX) gets loaded via Javascript when the MainPage.ASPX is finished loading.
<head runat="server">
<script type="text/javascript" language="javascript">
function LoadThisComp(lid){
if(IsNumeric(lid)==true){
document.getElementById("hCompToLoad").value = lid;
document.getElementById("bLoadComp").click();
}
}
function IsNumeric(sText) {
var ValidChars = "0123456789";
var Char;
for(i = 0; i < sText.length; i++) {
Char = sText.charAt(i);
if(ValidChars.indexOf(Char) == -1){
return false;
}
}
return true;
}
</script>
</head>
... body tags and other tables ...
<asp:ScriptManager ID="sM" runat="server" EnablePartialRendering="true" />
<asp:UpdatePanel ID="uP" runat="server">
<ContentTemplate>
... table with a bunch of labels and numeric textboxes ...
<asp:HiddenField ID="hCompToLoad" runat="server" />
<asp:Button ID="bLoadComp" runat="server" onClick="bLoadComp_Click" Text="" Style="display: none;" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:ScriptManager>
Code-Behind:
Protected Sub bLoadComp_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ListingID As Integer
If IsNumeric(hCompToLoad.Value) Then ListingID = CInt(hCompToLoad.Value)
If ListingID > 0 Then
PopulateFields(ListingID)
End If
End Sub