2010-08-02 138 views
0

我有一個頁面顯示在iframe中。 iframe使用UpdatePanel Ajax控件更新其中的表單。然而整個頁面在IE瀏覽器中刷新,儘管Firefox很好。驗證者也不會支付任何費用。我的代碼(使用Ajax)在iframe之外工作。發生了什麼?謝謝你的幫助。我的代碼是:updatepanel在iframe中加載整個頁面

容器頁面:

<IFRAME id="frame1" width="600px" frameborder="0" height="390px" src="http://www.site.ac. uk/page.aspx" runat="server"></IFRAME> 

page.aspx:

<form id="form1" runat="server"> 
<div class="results"> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"> 
</asp:ScriptManager> 

<h3>Enter amount</h3> 
    <span>$ <asp:TextBox CssClass="text" ID="TextBox1" runat="server"></asp:TextBox></span><br /> 


    <asp:Button ID="Button1" runat="server" CssClass="button" onClick="Button1_click" Text="Calculate" /> 
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic"></asp:RequiredFieldValidator> 
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic" 
    ErrorMessage="" ValidationExpression="^\d+$"></asp:RegularExpressionValidator> 


    <asp:UpdatePanel id="results" runat="server"> 
    <Triggers> 
    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> 
    </Triggers> 

    <ContentTemplate> 
    <div class="amount"> 
    <h3>Amount</h3> 
    <span>$ <asp:TextBox CssClass="text" ID="TextBox5" runat="server" ReadOnly="True"></asp:TextBox> </span><br /> 
</div> 


<h3>Total value:</h3> 
<span>$ <asp:TextBox ID="TextBox6" CssClass="text" runat="server" ReadOnly="True"></asp:TextBox> </span> 

    </ContentTemplate> 
    </asp:UpdatePanel> 
    </div> 

    </form> 

page.aspx.vb

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 

    TextBox5.Text = (TextBox1.Text * 0.333333).ToString("F2") 
    TextBox6.Text = Val(TextBox1.Text) + Val(TextBox5.Text) 
End Sub 

回答

相關問題