Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将值从一个Gridview传递到另一个页面Gridview_C# - Fatal编程技术网

C# 将值从一个Gridview传递到另一个页面Gridview

C# 将值从一个Gridview传递到另一个页面Gridview,c#,C#,你好,伙计们,我有一个带有gridview和链接按钮的页面视图All Appenders.aspx 当我单击链接按钮时,我想重定向到page View Appender Detail.aspx,我想在View Appender Detail.aspx页面上的gridview中根据上一页的值显示数据 以下是查看所有申请者的代码。aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="View All Applicant

你好,伙计们,我有一个带有gridview和链接按钮的页面视图All Appenders.aspx

当我单击链接按钮时,我想重定向到page View Appender Detail.aspx,我想在View Appender Detail.aspx页面上的gridview中根据上一页的值显示数据

以下是查看所有申请者的代码。aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="View All Applicants.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div><center>
        &nbsp;</center>
        <center style="background-color: silver">
            &nbsp;</center>
        <center>
            <strong><span style="font-size: 16pt">List of All Applicants</span></strong></center>
        <center style="background-color: silver">
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" AllowPaging="True"
                >
                <Columns>
                    <asp:BoundField DataField="PersonName" HeaderText="PersonName" SortExpression="PersonName" />
                    <asp:BoundField DataField="DegreeName" HeaderText="DegreeName" SortExpression="DegreeName" />
                    <asp:BoundField DataField="InstituteName" HeaderText="InstituteName" SortExpression="InstituteName" />
                    <asp:BoundField DataField="ExperienceYears" HeaderText="ExperienceYears" SortExpression="ExperienceYears" />
                    <asp:BoundField DataField="OrganizationName" HeaderText="OrganizationName" SortExpression="OrganizationName" />
                    <asp:BoundField DataField="Designation" HeaderText="Designation" SortExpression="Designation" />
                    <asp:TemplateField HeaderText="Applicant Detail">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Cancel"
                                OnClick="LinkButton1_Click" Text="View"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString8 %>"
                ProviderName="<%$ ConnectionStrings:ConnectionString8.ProviderName %>" SelectCommand="SELECT Distinct PERSONALDETAIL.PersonName, DEGREE.DegreeName, INSTITUTE.InstituteName, EXPERIENCE.ExperienceYears, EXPERIENCE.OrganizationName, EXPERIENCE.Designation FROM EXPERIENCE, EXPERIENCE EXPERIENCE_1, PERSONALDETAIL, DEGREE, INSTITUTE WHERE EXPERIENCE.ExperienceID = EXPERIENCE_1.ExperienceID">
            </asp:SqlDataSource>
        </center>
        <center>
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center style="background-color: silver">
            &nbsp;</center>
    </div>
    </form>
</body>
</html>

无标题页
所有申请人名单
和查看申请者详细信息.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="View Applicant Detail.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div><center>
        &nbsp;</center>
        <center style="background-color: silver">
            &nbsp;</center>
        <center>
            <strong><span style="font-size: 16pt">Job Applicant Detail</span></strong></center>
        <center style="background-color: silver">
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ResumeID"
                DataSourceID="SqlDataSource1">
                <Columns>
                    <asp:BoundField DataField="ResumeID" HeaderText="ResumeID" InsertVisible="False"
                        ReadOnly="True" SortExpression="ResumeID" />
                    <asp:BoundField DataField="TotalExperienceYears" HeaderText="TotalExperienceYears"
                        SortExpression="TotalExperienceYears" />
                    <asp:BoundField DataField="TotalExperienceMonths" HeaderText="TotalExperienceMonths"
                        SortExpression="TotalExperienceMonths" />
                    <asp:BoundField DataField="ExperienceSummary" HeaderText="ExperienceSummary" SortExpression="ExperienceSummary" />
                    <asp:BoundField DataField="DetailedCVName" HeaderText="DetailedCVName" SortExpression="DetailedCVName" />
                    <asp:BoundField DataField="AdditionalQualification" HeaderText="AdditionalQualification"
                        SortExpression="AdditionalQualification" />
                    <asp:BoundField DataField="ExtraCurricular" HeaderText="ExtraCurricular" SortExpression="ExtraCurricular" />
                    <asp:BoundField DataField="Skills" HeaderText="Skills" SortExpression="Skills" />
                    <asp:BoundField DataField="TentativeFromDate" HeaderText="TentativeFromDate" SortExpression="TentativeFromDate" />
                    <asp:BoundField DataField="PageIndex" HeaderText="PageIndex" SortExpression="PageIndex" />
                    <asp:BoundField DataField="PersonalDetailID" HeaderText="PersonalDetailID" SortExpression="PersonalDetailID" />
                    <asp:BoundField DataField="DepartmentID" HeaderText="DepartmentID" SortExpression="DepartmentID" />
                    <asp:BoundField DataField="DesignationID" HeaderText="DesignationID" SortExpression="DesignationID" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString5 %>"
                ProviderName="<%$ ConnectionStrings:ConnectionString5.ProviderName %>" SelectCommand="SELECT * FROM [RESUME]">
            </asp:SqlDataSource>
        </center>
        <center>
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center>
            &nbsp;</center>
        <center style="background-color: silver">
            &nbsp;</center>
    </div>
    </form>
</body>
</html>

无标题页
求职者详细信息

您不必使用postbask将用户重定向到详细信息页面,您可以编辑模板列,直接转到详细信息页面的URL以及查找所需ID的GET变量

            <asp:TemplateField HeaderText="Applicant Detail">
                <ItemTemplate>
                    <asp:HyperLink NavigateUrl="DetailsView.aspx?ResumeID=" + "<%# Bind("ResumeID") %>" Text="Visit W3Schools!" Target="_blank" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>

在详细信息页面中,执行Request.QueryString(“ResumeID”)以获取执行查找所需的ID

            <asp:TemplateField HeaderText="Applicant Detail">
                <ItemTemplate>
                    <asp:HyperLink NavigateUrl="DetailsView.aspx?ResumeID=" + "<%# Bind("ResumeID") %>" Text="Visit W3Schools!" Target="_blank" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>