关于多视图视图的问题 [英] Issue regarding View in Multiview

查看:69
本文介绍了关于多视图视图的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我单击button1,我想显示view1,如果我单击button2,我想显示view2,我有2个按钮

这是我为多视图设计的

I am having 2 buttons if i click on button1 i would like to show view1 and if on button2 i would like to show view2

This is my design for multiview

<asp:MultiView ID="MultiView2" runat="server" Visible="false">
                        <asp:View ID="View6" runat="server">
                            <asp:Label ID="lblAddress" runat="Server" Text="Address"></asp:Label>
                            <asp:DropDownList ID="ddlAddress" runat="Server">
                            </asp:DropDownList>
                            <br />
                            <br />
                            <asp:Label ID="lblAddress1" runat="server" Text="AddressLine1"></asp:Label>
                            &nbsp;
                            <asp:TextBox ID="txtAddrLine1" runat="server"></asp:TextBox>
                            <br />
                            <br />
                            <asp:Label ID="lblAddress2" runat="server" Text="AddressLine2"></asp:Label>
                            &nbsp;
                            <asp:TextBox ID="txtAddrLine2" runat="server"></asp:TextBox><br />
                            <br />
                            <asp:Label ID="lblCity1" runat="server" Text="City"></asp:Label>
                            &nbsp;
                            <asp:TextBox ID="txtCity1" runat="server"></asp:TextBox><br />
                            <br />
                            <asp:Label ID="lblStates" runat="server" Text="State"></asp:Label>
                            <asp:DropDownList ID="ddlStates" runat="server">
                            </asp:DropDownList><br />
                            <br />
                            <asp:Label ID="lblZip" runat="server" Text="ZipCode"></asp:Label>
                            <asp:TextBox ID="txtZip" runat="server"></asp:TextBox>
                            <br />
                            <br />
                            <asp:Label ID="lblCountry1" runat="server" Text="Country"></asp:Label>
                            <asp:TextBox ID="txtCountry1" runat="server"></asp:TextBox><br />
                            <br />
                            &nbsp;<asp:Button ID="btnSave" runat="server" Text="Save" CssClass="submit_buttons"

                                Width="54px" OnClick="btnSave_Click" /></asp:View>
                        <asp:View ID="viewPhone" runat="Server">
                            <asp:Label ID="lblPhonenoType" runat="server" Text="Phone Number Type"></asp:Label>
                            <asp:DropDownList ID="ddlPhnnoType" runat="server">
                            </asp:DropDownList>
                            <br />
                            <br />
                            <asp:Label ID="lblPhoneNumber1" runat="server" Text="PhoneNumber"></asp:Label>
                            <asp:TextBox ID="txtPhoneNumber" runat="server" Style="position: absolute"></asp:TextBox>
                        </asp:View>
                    </asp:MultiView>



我在每个button_click
上编写我的代码,如下所示



i write my code as follows on every button_click

MultiView2.Visible = true;
MultiView2.SetActiveView(View6);



对于button2



For button2

MultiView2.Visible = true;
MultiView2.SetActiveView(viewPhone);




但是我无法显示可视电话,但显示错误信息为

在MultiView2内部找不到视图View6,ActiveView必须是直接在MultiView内部的View控件.




But i am unable to show the viewphone i am getting the error as

The view View6 cannot be found inside MultiView2, the ActiveView must be a View control directly inside a MultiView.

推荐答案

在MultiView2内部找不到View6的视图
听起来像设置可见性的顺序,并且ActiveView不正确.此观察结果基于您的句子,即在使用可视电话时,您会遇到上述错误"

在此处查看有关如何实现 Multiviews 的详细信息和示例> [^ ].
The view View6 cannot be found inside MultiView2
Sounds like the sequence of setting visibility and the ActiveView is not correct. This observation is based on your sentence that, ''at the time of viewphone, you get the above error''

Have a look here for details and examples of how to implement Multiviews[^].


这篇关于关于多视图视图的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆