Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在事件中更改输入参数时使用Angular JS更新页面_C#_Angularjs - Fatal编程技术网

C# 如何在事件中更改输入参数时使用Angular JS更新页面

C# 如何在事件中更改输入参数时使用Angular JS更新页面,c#,angularjs,C#,Angularjs,我有一个使用webform(.aspx)、C#和一些Javascript的有效解决方案。在学习使用Angular JS时,我需要一些帮助 我正在寻找一种方法,将解决方案重新编写为AngularJS应用程序中的页面。示例页面有一个Dropdownlist服务器控件,当选择一个项目时,必须根据页面成员“configJson”的当前值更新div“axviewer”。configJson是一个从静态C#方法返回的值,该方法将SelectedItem作为输入 从你的问题中我可以理解,你想做的事情似乎并不

我有一个使用webform(.aspx)、C#和一些Javascript的有效解决方案。在学习使用Angular JS时,我需要一些帮助

我正在寻找一种方法,将解决方案重新编写为AngularJS应用程序中的页面。示例页面有一个Dropdownlist服务器控件,当选择一个项目时,必须根据页面成员“configJson”的当前值更新div“axviewer”。configJson是一个从静态C#方法返回的值,该方法将SelectedItem作为输入




从你的问题中我可以理解,你想做的事情似乎并不复杂,但我建议你首先自己尝试一下

我可以给你一些提示

首先,在angular中有一个自定义指令来模拟您根据所选项目操作DIV所做的操作

暗示

然后使用ng select指令更改下拉选择。

如果你是初学者,我建议你先用这个来在你的头脑中清楚地描绘出什么是角的

我希望这能解决你的问题

  <html> <head>
    <title>ActiveX Viewer Sample Launch Page</title>
            <script type="text/javascript">
        $(document).ready(function () {
            // configJson is updated and returned by a C# public static method
            // based on the selection in the list
            var ax = igc.be.client.activex.createInstance(<% =configJson %>);
            ax.render("axviewer");            
        });
    </script> </head> <body>    
    <form runat="server">
        <input type="button" id="prev" value='<' />
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" >
            <asp:ListItem>288</asp:ListItem>      
            <asp:ListItem>483</asp:ListItem>
            <asp:ListItem>488</asp:ListItem>
            <asp:ListItem>501</asp:ListItem>                              
        </asp:DropDownList>
    </form>
     <hr />
    <%--Display the Brava Viewer--%>    
    <div id="axviewer"></div>

    <div id="errorMesage" runat="server" visible="false">
        <asp:Label runat="server" ForeColor="Red" ID="Description">Something is wrong!</asp:Label>
    </div> </body> </html>
    protected void Page_Load(object sender, EventArgs e)
    {
        errorMesage.Visible = false;           
        string docId = "273";
        try
        {
            // return a json config string                
            var selectedId = this.DropDownList1.SelectedValue;
            instanceId = this.DropDownList1.SelectedValue;
            configJson = ActiveXViewer.GetViewerConfigJson(instanceId, "admin:admin", docId);  

        }
        catch (Exception ex)
        {
            errorMesage.Visible = true;
            Description.Text = ex.Message;

        }
    }