473,387 Members | 1,624 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,387 software developers and data experts.

store the emp_no into a string when check the checkbox

i use ASP.NET 2005
I use gridview to display the Employ information.And display a checkbox filed inside the gridview add as a template.
I want to store the emp_no into a variable when i checked this chechbox corresponding to the field(row).
Please anybody help me.If it is possible.
my code-----
<asp:GridView ID="grdempinf" runat="server" AutoGenerateSelectButton="True" OnSelectedIndexChanged="grdempinf_SelectedIndexCha nged">
<Columns>
<asp:TemplateField HeaderText="Employ">
<ItemTemplate>
<asp:CheckBox ID="chkemp" runat="server"/>
</ItemTemplate>
</asp:TemplateField>
Apr 12 '08 #1
2 1107
balame2004
142 100+
i use ASP.NET 2005
I use gridview to display the Employ information.And display a checkbox filed inside the gridview add as a template.
I want to store the emp_no into a variable when i checked this chechbox corresponding to the field(row).
Please anybody help me.If it is possible.
my code-----
<asp:GridView ID="grdempinf" runat="server" AutoGenerateSelectButton="True" OnSelectedIndexChanged="grdempinf_SelectedIndexCha nged">
<Columns>
<asp:TemplateField HeaderText="Employ">
<ItemTemplate>
<asp:CheckBox ID="chkemp" runat="server"/>
</ItemTemplate>
</asp:TemplateField>

Hi,

Add OnCheck event to the checkbox and write relevant code in the event method to save emp_no into a variable

Cheers,
Balaji U
Apr 14 '08 #2
r035198x
13,262 8TB
@OP Please do not double post.
You other identical thread has been removed.
Apr 14 '08 #3

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

Similar topics

4
by: Christopher Brandsdal | last post by:
Hi! I have a delicatg problem.... I have made a registration form for adding my friends information in a database. The problem is that I want to connect the persons with companies in the same...
3
by: Rich | last post by:
I have a form with 2 check boxes. One of the check boxes is used to specify that the user is a "primary contact." When I check the primary contact box I want a second box for "standard contact"...
3
by: Lauren Quantrell | last post by:
This a a long convoluted string parsing question... I have a string in an Access 2K database table field that I use for noting if a user has checked a record. The string goes like this: xy So...
3
by: Mason | last post by:
I want to do a for loop through 45 check boxes, whose names are CheckBox1 ... CheckBox 45. I'd like to do something like this: Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As...
2
by: LisaBigJax | last post by:
I am using a series of checkbox's in a repeater -- (not the checkboxlist) -- the problem I am encountering is that the checkbox does not have a value attribute. I tried to add it via the...
10
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not...
17
by: shivasusan | last post by:
Hi! In my program, I have multiple check boxs.(more the 10) But i give rights to select 2 check boxs, If i select more then 2 check boxs, I want to display alert message. Please any one post...
2
by: bmerlover | last post by:
Hello, I have written my code in Visual C++ using .NET Framework. I have several checkboxes on my GUI and I would like to give the user the option of saving the current state of the checkboxes. I...
0
by: dotnetrookie | last post by:
Hi This is my 1st post.I have two checkbox columns in gridview binded through item template. The checkboxes are Category and Subcategory. I have actually removed the duplicate values in the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.