<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SelectDialog.ascx.cs" Inherits="Solution.Admin.Controls.SelectDialog" %>
<asp:HiddenField ID="HiddenFieldSelectValue" runat="server" Value="" />
<asp:HiddenField ID="HiddenFieldSelectText" runat="server" Value="" />
<!--类别选择-->
<link href="/css/bx.ui.css" rel="stylesheet" />
<script src="/js/bx.ui.js"></script>
<script type="text/javascript">
    var tidstr = "<%=this.HiddenFieldSelectText.ClientID%>";
    var vidstr = "<%=this.HiddenFieldSelectValue.ClientID%>";
    var txtidstr = "<%=this.txtCategory.ClientID%>";
    function loadCategory() {
        var txt = '<iframe id="SelectWindowIframe" callback="CategorySelectCallback" scrolling="no" name="SelectWindowIframe" frameborder="0" width="400" height="360" src="../Contents/SelectWindow.html#001"></iframe>';
        bx.popup.dialog({ "title": "类别选择:", "text": txt, "button": "ok" });
    }
    function loadArea() {
        var txt = '<iframe id="SelectWindowIframe" callback="CategorySelectCallback" scrolling="no" name="SelectWindowIframe" frameborder="0" width="400" height="360" src="../Contents/SelectWindow.html#002"></iframe>';
        bx.popup.dialog({ "title": "城市选择:", "text": txt, "button": "ok" });
    }
    function CategorySelectCallback(param) {
        document.getElementById(txtidstr).value = document.getElementById(tidstr).value = param[0].text;
        document.getElementById(vidstr).value = param[0].value;
        bx.popup.close();
    }

</script>
<% txtCategory.Text = this.Text; %>

<table border="0" style="margin-left: 0px;">
    <tr>
        <td style="margin: 0px; padding: 0px;">
            <asp:TextBox ID="txtCategory" runat="server" Enabled="false" Width="260"></asp:TextBox>
            <%if (Type.Equals("category"))
              {%>

            <asp:Button ID="Button1" OnClientClick="loadCategory();return false;" runat="server" Text="选择" />
            <%}
              else if (Type.Equals("area"))
              { %>
                <asp:Button ID="Button3" OnClientClick="loadArea();return false;" runat="server" Text="选择" />
            <%} %>
        </td>
        <td>&nbsp;</td>
    </tr>
</table>

<script type="text/javascript">
    document.getElementById(txtidstr).value = document.getElementById(tidstr).value;
</script>
