Hi,
I have the following code in my asp page. I would like to click on Select button and get the logoid which is in a hidden field. but it won't work when i click on the button.
<telerik:RadListView ID="dvlogo1" runat="server" DataSourceID="dslogo"
ItemPlaceholderID="PlaceHolder1" AllowPaging="true" OnItemCommand="dvlogo1_ItemCommand" >
<LayoutTemplate>
<div class="sushibar">
<asp:Panel ID="SushiPanel" runat="server">
<div class="sushi">
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
<telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="10" Skin="Black">
<Fields>
<telerik:RadDataPagerButtonField FieldType="Numeric" />
</Fields>
</telerik:RadDataPager>
</asp:Panel>
</div>
</LayoutTemplate>
<ItemTemplate>
<div class="category">
<p><asp:HiddenField runat="server" ID="hidlogoid" Value='<%# Eval("logoid") %>' />
<%#Eval("Title") %>
</p>
<asp:Image runat="server" ID="imglogo2" Height="70px" Width="70px" ImageUrl='<%# Eval("logopath") %>' />
<p>
<asp:Button runat="server" ID="cmdselectlogo2" Text="Select" Font-Size="10px" CommandName="select" CommandArgument='<%# Eval("logopath") %>' />
</p>
</div>
</ItemTemplate>
<SelectedItemTemplate>
<div class="selected">
<p><asp:HiddenField runat="server" ID="hidlogoid1" Value='<%# Eval("logoid") %>' />
<%#Eval("Title") %>
</p>
<asp:Image runat="server" ID="imglogo2" Height="70px" Width="70px" ImageUrl='<%# Eval("logopath") %>' />
<p>
<asp:Button runat="server" ID="cmdselectlogo2" Text="Select" Font-Size="10px" CommandName="select" CommandArgument='<%# Eval("logopath") %>' />
</p>
</div>
</SelectedItemTemplate>
</telerik:RadListView>
C# Code
protected void dvlogo1_ItemCommand(object source, RadListViewCommandEventArgs e)
{
if (e.CommandName == RadListView.SelectCommandName)
{
RadListViewDataItem item = e.ListViewItem as RadListViewDataItem;
string myValue = item.GetDataKeyValue("logoid").ToString();
}
//switch (e.CommandName)
//{
// case "selectlogo":
// Session["logo"] = e.CommandArgument;
// // hid = (this.dvlogo1.FindControl("hidlogoid") as HiddenField).Value;
// Session["logoid"] = (this.dvlogo1.FindControl("hidlogoid") as HiddenField).Value;
// break;
//}
}
I appreciate your help very much.
thanks,
kamal
I have the following code in my asp page. I would like to click on Select button and get the logoid which is in a hidden field. but it won't work when i click on the button.
<telerik:RadListView ID="dvlogo1" runat="server" DataSourceID="dslogo"
ItemPlaceholderID="PlaceHolder1" AllowPaging="true" OnItemCommand="dvlogo1_ItemCommand" >
<LayoutTemplate>
<div class="sushibar">
<asp:Panel ID="SushiPanel" runat="server">
<div class="sushi">
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
<telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="10" Skin="Black">
<Fields>
<telerik:RadDataPagerButtonField FieldType="Numeric" />
</Fields>
</telerik:RadDataPager>
</asp:Panel>
</div>
</LayoutTemplate>
<ItemTemplate>
<div class="category">
<p><asp:HiddenField runat="server" ID="hidlogoid" Value='<%# Eval("logoid") %>' />
<%#Eval("Title") %>
</p>
<asp:Image runat="server" ID="imglogo2" Height="70px" Width="70px" ImageUrl='<%# Eval("logopath") %>' />
<p>
<asp:Button runat="server" ID="cmdselectlogo2" Text="Select" Font-Size="10px" CommandName="select" CommandArgument='<%# Eval("logopath") %>' />
</p>
</div>
</ItemTemplate>
<SelectedItemTemplate>
<div class="selected">
<p><asp:HiddenField runat="server" ID="hidlogoid1" Value='<%# Eval("logoid") %>' />
<%#Eval("Title") %>
</p>
<asp:Image runat="server" ID="imglogo2" Height="70px" Width="70px" ImageUrl='<%# Eval("logopath") %>' />
<p>
<asp:Button runat="server" ID="cmdselectlogo2" Text="Select" Font-Size="10px" CommandName="select" CommandArgument='<%# Eval("logopath") %>' />
</p>
</div>
</SelectedItemTemplate>
</telerik:RadListView>
C# Code
protected void dvlogo1_ItemCommand(object source, RadListViewCommandEventArgs e)
{
if (e.CommandName == RadListView.SelectCommandName)
{
RadListViewDataItem item = e.ListViewItem as RadListViewDataItem;
string myValue = item.GetDataKeyValue("logoid").ToString();
}
//switch (e.CommandName)
//{
// case "selectlogo":
// Session["logo"] = e.CommandArgument;
// // hid = (this.dvlogo1.FindControl("hidlogoid") as HiddenField).Value;
// Session["logoid"] = (this.dvlogo1.FindControl("hidlogoid") as HiddenField).Value;
// break;
//}
}
I appreciate your help very much.
thanks,
kamal