473,467 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CommandArgument returns empty string.

26 New Member
I have a datagrid using link button. I am setting the CommandArgument value as ..

Expand|Select|Wrap|Line Numbers
  1. <asp:linkbutton runat="server" 
  2.         EnableViewState=True 
  3.         CommandArgument='<%# DataBinder.Eval(Container.DataItem, "EmpId")%>'
  4. ....>
In the .aspx.vb file I am referring this value as..
Expand|Select|Wrap|Line Numbers
  1. Private Sub results_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles results.ItemCommand
  2.    If e.CommandName = "Delete" Then
  3.       Dim sEmpId As String = e.CommandArgument
  4.  
The sEmpId is returning empty.
But If I hard code the value of CommandArgument as..
Expand|Select|Wrap|Line Numbers
  1. <asp:linkbutton runat="server" 
  2.         EnableViewState=True 
  3.         CommandArgument='190765
  4. '....>
Its giving the correct value.. any idea why its not returning the value ?

Regards,
Renil.
Apr 3 '07 #1
3 9392
shweta123
692 Recognized Expert Contributor
Hi,

Probably ,EmpId may be containing Null for that row.You can Debug by assigning some other column.
Apr 3 '07 #2
Renilkumar
26 New Member
Hi,

Probably ,EmpId may be containing Null for that row.You can Debug by assigning some other column.
No its not NULL.
Apr 3 '07 #3
jirkamat
1 New Member
I had this problem too, and I solved it by disabling ViewState on the LinkButton.
Apr 25 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns...
0
by: Solomon Shaffer | last post by:
I have a datagrid that I am adding a template column to (containing a couple of linkbuttons) at runtime and am having some difficulty setting the commandargument or the linkbuttons. Does anyone...
1
by: Gilles T. | last post by:
Hi, I need to passing parameters in CommandArgument of the asp:ImageButton. I don't use datagrid or datalist Here is my code: Private Sub ImageButtonCommandHandler( sender As Object, e As...
1
by: Gilles T. | last post by:
Hi, I need to passing parameters in CommandArgument of the asp:ImageButton. I don't use datagrid or datalist Here is my code: Private Sub ImageButtonCommandHandler( sender As Object, e As...
2
by: Benjamin Joldersma | last post by:
Hello all, My basic problem is that my LinkButton does not support a data bound CommandArgument property under certain cases. The intent is to filter my datagrid based on a specific row's...
1
by: Fabrice | last post by:
Hello Is it possible to modify CommandArgument property of a LinkButton from vb class (code behind). So, this is my control in my .aspx page : <asp:LinkButton id="strTd"...
1
by: keithb | last post by:
I have a command button in GridView row that fires the RowCommand Event when clicked. The event handler looks like this: protected void grid_RowCommand(Object sender, GridViewCommandEventArgs e)...
2
by: David | last post by:
I have a template field in a GridView that contains two ImageButtons. When the user clicks one of the buttons, the GridView's RowCommand event is fired and I can get the CommandName. All that is...
1
by: Leon Mayne | last post by:
Hello, I have a gridview that's bound to a generic list of business objects and am using the RowCommand event to capture user clicks on actions. This was working fine up until today, but now...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.