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

How data of row send to webpage when we click on LinkButton in GridView

Hello,

I have a GridView with some fields and at the end their is link button. How I send row data to webpage when user click on linkbutton.

I search and come to know that DataRowView is used but don't find any example. Please share some example that how to use DataRowView.

Thank you
Jan 19 '16 #1

✓ answered by SalmanMushtaq

For this purpose we below code inside Gridview..
Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateField HeaderText="LinkButton">
  2. <ItemTemplate>
  3. <asp:LinkButton runat="server" CommandName="link_button" Text="I am Link Button" onCommand="abc" CommandArgument='<%#Eval("Field name you want to send") %>' </asp:LinkButton>
  4. </ItemTemplate>
  5.  
  6. </asp:TemplateField>
  7.  
  8.  
In code of abc

Expand|Select|Wrap|Line Numbers
  1. if(e.CommandName.Equal("link_button"))
  2. {
  3. //code of database base on e.CommandArgument
  4. }
  5.  

1 1468
For this purpose we below code inside Gridview..
Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateField HeaderText="LinkButton">
  2. <ItemTemplate>
  3. <asp:LinkButton runat="server" CommandName="link_button" Text="I am Link Button" onCommand="abc" CommandArgument='<%#Eval("Field name you want to send") %>' </asp:LinkButton>
  4. </ItemTemplate>
  5.  
  6. </asp:TemplateField>
  7.  
  8.  
In code of abc

Expand|Select|Wrap|Line Numbers
  1. if(e.CommandName.Equal("link_button"))
  2. {
  3. //code of database base on e.CommandArgument
  4. }
  5.  
Jan 20 '16 #2

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

Similar topics

10
by: BadOmen | last post by:
I want my program to send a mouse click to the window at the current mouse position, how do I do that? Example: I have my mouse over a button in Word and then my program is sending the left...
0
by: yoganand reddy | last post by:
Hello, we are developing component in c# like a datagrid , if u are selecting any cell in grid it selects the total row and display record there itself , if any body have this idea please share...
6
by: shivavrata | last post by:
Hi All, I want to transfer the data form webpage to any other own application which is running in backend.How i develop this web page. which technology is good for this or any particular protocol...
0
by: Gabriel León | last post by:
Hi, Im developing a web site. i have a couple of tables in my sql server 2000 and i want them to be displayed by the same gridview by changing the objectdatasource or tableadapter or whatever. ...
5
by: Rishika14 | last post by:
Hi, Somebody pls tell me how to export data from webpage to excel sheet using java script. rishika
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
15
by: Peter | last post by:
I have the following web page and I am trying to have the Field lables NOT to wrap. It looks fine in a designer but when I run the program in a browser the lables that have a space wrap. How do I...
2
by: sachin satav | last post by:
I want send Info on particular E-Mail ID when click on send button on form in ASP .Net .
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.