1

Hi all I am using chosen master plugin in my web page chosen-master

I want to use it to select user or post.. But when I select a option its just write selected value to data-placeholder.I put hyperlink inside options to give navigate url but nothing change.Is it possible ?

 <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>
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
serdar
  • 454
  • 1
  • 8
  • 26

1 Answers1

1

I solved my problem with this way.Maybe I can help someone. I saw this solve at Marks answer.(Thanks 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>
Community
  • 1
  • 1
serdar
  • 454
  • 1
  • 8
  • 26