1

大家好,我在我的网页中使用选择的主插件selected-master

我想用它来选择用户或帖子。但是当我选择一个选项时,它只是将选定的值写入数据占位符。我将超链接放在选项中以提供导​​航 url,但没有任何改变。有可能吗?

 <select data-placeholder="#Post ara, @Kullanıcı ara" style="width:300px; margin-top:10px; margin-left:0px;" class="chzn-select" tabindex="5" >
                 <option value=""></option>
                 <optgroup label="Postlar">
                 <asp:Repeater ID="rpt_Post" runat="server" DataSourceID="ods_postlist">
                 <ItemTemplate>
                 <option><asp:HyperLink ID="hypPost" runat="server"  NavigateUrl='<%# "~/Post.aspx?post_id="+ Eval("post_id") %>' Text='<%# "# " + Eval("post_baslik") %>'></asp:HyperLink></option>
                 </ItemTemplate>
                </asp:Repeater>
                <asp:ObjectDataSource ID="ods_postlist" runat="server" SelectMethod="PostListesiGetir" TypeName="yonet"></asp:ObjectDataSource>
                   </optgroup>
                 <optgroup label="Kullanıcılar">
                 <asp:Repeater ID="rpt_kullanici" runat="server" DataSourceID="ods_kullanicilist">
                     <ItemTemplate>
                 <option><asp:HyperLink ID="hyp_Profillist" runat="server" Text='<%# "@ " + Eval("UserName") %>' NavigateUrl='<%# "~/profil.aspx?user_id=" + Eval("UserId") %>'></asp:HyperLink></option>
                    </ItemTemplate>
                  </asp:Repeater> 
                   <asp:ObjectDataSource ID="ods_kullanicilist" runat="server" SelectMethod="KullaniciListesiGetir" TypeName="yonet"></asp:ObjectDataSource>
                 </optgroup>
                 <optgroup label="Diğer">
                     <option>Ayrıntılı Ara</option>
                 </optgroup>


    </select>
4

1 回答 1

1

我用这种方式解决了我的问题。也许我可以帮助别人。我在Marks answer 看到了这个解决方案。(感谢 Mark Eirich)

<select data-placeholder="#Post ara, @Kullanıcı ara" style="width:300px; margin-top:10px; margin-left:0px;" class="chzn-select" tabindex="5" *onchange="if (this.value) window.location.href=this.value"* >
             <option value=""></option>
             <optgroup label="Postlar">
             <asp:Repeater ID="rpt_Post" runat="server" DataSourceID="ods_postlist">
             <ItemTemplate>
             <option value='<%# "Post.aspx?post_id="+ Eval("post_id") %>'><%# "# " + Eval("post_baslik") %>'></option>
             </ItemTemplate>
            </asp:Repeater>
            <asp:ObjectDataSource ID="ods_postlist" runat="server" SelectMethod="PostListesiGetir" TypeName="yonet"></asp:ObjectDataSource>
               </optgroup>
             <optgroup label="Kullanıcılar">
             <asp:Repeater ID="rpt_kullanici" runat="server" DataSourceID="ods_kullanicilist">
                 <ItemTemplate>
             <option value='<%# "profil.aspx?user_id=" + Eval("UserId") %>'><%# "@ " + Eval("UserName") %></option>
                </ItemTemplate>
              </asp:Repeater> 
               <asp:ObjectDataSource ID="ods_kullanicilist" runat="server" SelectMethod="KullaniciListesiGetir" TypeName="yonet"></asp:ObjectDataSource>
             </optgroup>
             <optgroup label="Diğer">
                 <option>Ayrıntılı Ara</option>
             </optgroup>


</select>
于 2013-04-15T11:06:47.753 回答