473,440 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

asp:linkbutton - commandname behaviour

Hi,

The OnSelectedIndexChanged event only seems to fire if commandname = "select" if i change it to anything else if does not fire.
Can anyone explain why this is the case given this name is meant to be capable of being set to anything?

Thank you.
<ASP:DataList id="MyDataList" OnSelectedIndexChanged="MyDataList_Select" DataKeyField="title_id" runat="server">

<ItemTemplate>

<table cellpadding=10 style="font: 10pt verdana">
<tr>
<td valign="top">
<img align="top" width="25" border=1 src='<%# DataBinder.Eval(Container.DataItem, "title_id", "/quickstart/aspplus/images/title-{0}.gif") %>' runat="server" ID="Img1"/>
</td>
<td valign="top">
<b>Title: </b>
<asp:linkbutton Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' CommandName="Select" style="color:darkred" runat="server" ID="Linkbutton1"/>

Nov 19 '05 #1
2 2983
"John Blair" <jo********@hotmail.com> wrote in message news:iH**************@newsfe1-win.ntli.net...
Hi,

The OnSelectedIndexChanged event only seems to fire if commandname = "select" if i change it to anything else if does not fire.
Can anyone explain why this is the case given this name is meant to be capable of being set to anything?

It is capable of being set to anything, but only "select" means that the SelectedIndexChanged event should be fired. In the same way, "update" will fire the UpdateCommand event and "cancel" will fire the CancelCommand event.

If you want to use a command name other than the standard ones, you can pick up the click within the ItemCommand event handler.

John Saunders

Nov 19 '05 #2
Thanks a lot!
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message news:uq**************@tk2msftngp13.phx.gbl...
"John Blair" <jo********@hotmail.com> wrote in message news:iH**************@newsfe1-win.ntli.net...
Hi,

The OnSelectedIndexChanged event only seems to fire if commandname = "select" if i change it to anything else if does not fire.
Can anyone explain why this is the case given this name is meant to be capable of being set to anything?

It is capable of being set to anything, but only "select" means that the SelectedIndexChanged event should be fired. In the same way, "update" will fire the UpdateCommand event and "cancel" will fire the CancelCommand event.

If you want to use a command name other than the standard ones, you can pick up the click within the ItemCommand event handler.

John Saunders

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fresh Air Rider | last post by:
Hi Could anyone please give me the syntax for calling a function with more than one parameter from an <asp:LinkButton> ? Many thanks John
17
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
0
by: Fresh Air Rider | last post by:
Can anyone please tell me why I get a javascript error (expected ';') when I simply add an <asp:LinkButton> to a User Control and the reference that user control in a webpage ? The...
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
5
by: George Durzi | last post by:
I currently have an href inside of an asp:repeater <a href='<%# String.Concat("PDFReader.aspx?id=", DataBinder.Eval(Container.DataItem, "ProductUniqueId")) %>' target="_blank">View</a> ...
2
by: BobLaughland | last post by:
Hi There, I need a control on my site that is a hyperlink style control, but it must, 1) Have a property that can hold where the hyperlink is pointing to. (e.g. like the NavigateUrl property...
2
by: dddan | last post by:
Here's my code: <asp:LinkButton OnClick="DeleteFile" OnClientClick="if (!confirm ('Are you certain you want to delete this file?') ) return false;" runat="server" ID="DeleteButton">DELETE...
2
by: =?Utf-8?B?QWxleA==?= | last post by:
I have an asp linkbutton declared as follows: <asp:LinkButton ID="LinkButton1" runat="server" CssClass="tt">ASP Link Button</asp:LinkButton> My CSS classes are declared as follows: a.tt {...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.