⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quotesserviceclient.aspx

📁 《ASP.NET 2.0 XML 高级编程(第3版)》 《ASP.NET 2.0 XML 高级编程(第3版)》
💻 ASPX
字号:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Services.Protocols" %>

<script runat="server">
    void btnGetQuote_Click(object sender, EventArgs e)
    {
        try
        {
            QuotesProxy.QuotesService obj = new QuotesProxy.QuotesService();
            output.Text = obj.GetStockPrice(txtSymbol.Text).ToString();
        }
        catch (SoapException soapEx)
        {
            output.Text = "Actor: " + soapEx.Actor + "<br><br>";
            output.Text += "Code: " + soapEx.Code + "<br><br>";
            output.Text += "Message: " + soapEx.Message + "<br><br>";
            output.Text += "Node: " + soapEx.Node;            
        }
        catch (Exception ex)
        {
            output.Text = "Exception is : " + ex.Message;
        }
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Handling Exceptions returned from a Web Service</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Enter Stock Symbol: <asp:TextBox runat="server" ID="txtSymbol" />
        <asp:Button Text="Get Quote" runat="server" ID="btnGetQuote" OnClick="btnGetQuote_Click" />
        <br /><br /><br />
        <asp:Label Font-Bold=true runat="server" ID="output" />
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -