我有一个信用申请注册页面。它只是一个正常的注册页面,包括姓名,地址,公司和信用请求(钱)。之后,它从管理页面中的gridview(viewcredirequest.aspx)查看,这里是aspx的代码:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="table table-hover table-striped">
<Columns>
<asp:BoundField DataField="LastName" HeaderText="LastName"
SortExpression="LastName" />
<asp:BoundField DataField="FirstName" HeaderText="FirstName"
SortExpression="FirstName" />
<asp:BoundField DataField="CompanyName" HeaderText="CompanyName"
SortExpression="CompanyName" />
<asp:BoundField DataField="EmailAddress" HeaderText="EmailAddress"
SortExpression="EmailAddress" />
<asp:BoundField DataField="CompanyAddress" HeaderText="CompanyAddress"
SortExpression="CompanyAddress" />
<asp:BoundField DataField="IncomeRange" HeaderText="IncomeRange"
SortExpression="IncomeRange" />
<asp:BoundField DataField="CreditRequest" HeaderText="CreditRequest"
SortExpression="CreditRequest" />
<asp:BoundField DataField="ContactNumber" HeaderText="ContactNumber" SortExpression="ContactNumber" />
</Columns>
</asp:GridView>
以下是代码:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["IslandGasAdminFM"] != null)
{
bindgrid();
Label1.Text = "- Finance Manager";
}
else
{
Response.Redirect("LogIn.aspx");
}
}
public void bindgrid()
{
SqlConnection conn = new SqlConnection("Data Source = 'PAULO'; Initial Catalog=ShoppingCartDB;Integrated Security =True");
SqlCommand cmd = new SqlCommand("select * from CreditRequests ", conn);
SqlDataAdapter da = new SqlDataAdapter("", conn);
da.SelectCommand = new SqlCommand("select * from CreditRequests", conn);
DataSet ds = new DataSet();
da.Fill(ds, "data");
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}
我的数据库值如下:LastName,FirstName CompanyName,EmailAddress,CompanyAddress,IncomeRange,Creditrequest和ContactNumber。 Creditrequest来自下拉列表。
我想要的是将信用请求值从gridview转移到我的viewprofile.aspx中的文本框。另外一件事,我想到的是,当我点击特定行上的链接时,信用请求值将在用户名的viewprofile上可用?请帮助我得到一些参考或任何关于如何做到这一点的想法。谢谢!
就像您批准信用申请时一样,信用申请价值将通过文本框传递给该用户名的个人资料页面。