TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
avijit chatterjee
NA
16
0
i have some data in a Gridview....
May 13 2010 11:34 PM
i have some data in a Gridview and in that there is a HyperLink field and when user click on that link i have to see respective data of that ID in a new linked page. I am sending my .aspxpage and code-behind page.if possible please help me out...
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="Ecode,EmployeeName,Designation,Location"
DataNavigateUrlFormatString="UpdatePage.aspx?ECODE={0}&ENAME={1}&;DESIGNATION={2}&;LOCATION={3}"
Text="clickToUpdatePage" />
<asp:TemplateField HeaderText="ECODE" Visible="true">
<ItemTemplate>
<asp:Label ID="LABELCODE" runat="server" Text='<%# Eval("ECODE") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
code-behind page:-
public partial class EmpFetch : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//if (!IsPostBack)
}
protected void submit_Click(object sender, EventArgs e)
{
Library lib = new Library();
string sEmp_name = empname.Text;
DataTable dtEmpDetail = new DataTable();
dtEmpDetail = lib.GetEmpInfo(sEmp_name);
if (dtEmpDetail.Rows.Count > 0)
{
grdJobHistory.DataSource = dtEmpDetail;
grdJobHistory.DataBind();
}
}
protected void grdJobHistory_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
Library lib = new Library();
string sEmp_name = empname.Text;
DataTable dtEmpDetail = new DataTable();
dtEmpDetail = lib.GetEmpInfo(sEmp_name);
if (dtEmpDetail.Rows.Count > 0)
{
grdJobHistory.PageIndex = e.NewPageIndex;
grdJobHistory.DataSource = dtEmpDetail;
grdJobHistory.DataBind();
}
}
}
Reply
Answers (
3
)
How Do I: Change a DataGridView from a Class called?
see a list of customers located in the customer table in my database (SQL server) using C #