如何在中继器控件中查找选定的链接按钮值
我有一个关于链接按钮的问题,在我的网站上,我有一个待售产品页面,其中有一个带有过滤器选项的 ryt 侧栏 左侧栏显示过滤结果。 在我的 ryt 侧边栏上,我使用了手风琴和中继器控件,该控件显示数据库中的搜索条件。 例如我有2个搜索条件型号和价格,在型号手风琴下有三个型号,我想要实现的是 当用户单击该特定模型时,页面应针对该单击运行查询并在 左侧栏的中继器,我知道获取结果的查询,但我不知道如何获取该值 的超链接按钮,因为这些按钮将是动态的,可以是 3,4 或 10。我如何获得单击的超链接值 这样我就可以根据所选模型运行查询。 任何帮助或教程将不胜感激。
AutoSize="None"
FadeTransitions="true"
TransitionDuration="250"
FramesPerSecond="40"
RequireOpenedPane="false"
SuppressHeaderPostbacks="true">
<Panes>
<asp:AccordionPane ID="AccordionPane1" runat="server" >
<Header>
Make
</Header>
<Content>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li>
<asp:LinkButton ID="LinkButton2" runat="server" Text='<%# Eval("make") %>'></asp:LinkButton>
</li>
</ItemTemplate>
</asp:Repeater>
</Content>
</asp:AccordionPane>
<asp:AccordionPane ID="AccordionPane2" runat="server" >
<Header>
Price
</Header>
<Content>
</Content>
</asp:AccordionPane>
</Panes>
</asp:Accordion>
I have an issue regarding link button, On my website i have got a product for sale page, which has a ryt side bar with filter options
while the left side bar shows the filteration results.
On my ryt sidebar i have used accordion with the repeater control which display the searching criteria from database.
For instance I have 2 searching criteria model and price , under model accordion there are three models, what I want to acheive is
when a user clicks on that specific model , the page should run a query with respect to that click and show bind the results on the
repeater of the left side bar, I know the query to get the results but I dunno how to get the value
of that hyper link button, coz these buttons will be dynamic it can be 3,4 or 10. how will i get the clicked hyperlink value
so that I can run the query depending on the model selected.
Any help or tutorial will highly be appreciated.
AutoSize="None"
FadeTransitions="true"
TransitionDuration="250"
FramesPerSecond="40"
RequireOpenedPane="false"
SuppressHeaderPostbacks="true">
<Panes>
<asp:AccordionPane ID="AccordionPane1" runat="server" >
<Header>
Make
</Header>
<Content>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li>
<asp:LinkButton ID="LinkButton2" runat="server" Text='<%# Eval("make") %>'></asp:LinkButton>
</li>
</ItemTemplate>
</asp:Repeater>
</Content>
</asp:AccordionPane>
<asp:AccordionPane ID="AccordionPane2" runat="server" >
<Header>
Price
</Header>
<Content>
</Content>
</asp:AccordionPane>
</Panes>
</asp:Accordion>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置 CommandArgument链接按钮。
然后访问 CommandArgument:
Set the CommandArgument of the LinkButton.
Then to access the CommandArgument: