<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div align ="right">
<asp:ImageButton ID="ImageButton2" runat="server" Height="42px" ImageUrl="~/back.png" OnClick="ImageButton2_Click" />
<asp:ImageButton ID="ImageButton1" runat="server" Height="45px" ImageUrl="~/gnome-logout-icone-3872-128.png" OnClick="ImageButton1_Click" />
</div>
<div align="center">
<asp:Label ID="lb1" runat="server" Text="Label"></asp:Label>
<h1><font color="olive">User Details</font></h1>
<table border="1" style="border-collapse: collapse; width: 369px;" cellspacing="1">
<tr>
<td width="77" height="16" align="left" ><b><font size="2" color="red">Name:</font></b></td>
<td width="77" height="16" align="left" ><b><font size="2"> <asp:Label
ID="UserName" runat="server" Font-Bold="True"></asp:Label><br /></font></b></td>
<td width="77" height="16" align="left" ><b><font size="2" color="red">StaffCode:</font></b></td>
<td width="77" height="16" align="left" ><b><font size="2"> <asp:Label
ID="lbl_address" runat="server" Font-Bold="True"></asp:Label><br /></font></b></td>
<td width="77" height="16" align="left" ><b><font size="2" color="red">Branch:</font></b></td>
<td width="77" height="16" align="left" ><b><font size="2"> <asp:Label
ID="lbl_sal" runat="server" Font-Bold="True"></asp:Label><br /></font></b></td>
<td width="77" height="16" align="left" ><b><font size="2" color="red">Designation:</font></b></td>
<td width="77" height="16" align="left" ><b><font size="2"> <asp:Label
ID="lbl_phone" runat="server" Font-Bold="True"></asp:Label><br /></font></b></td>
</td>
</tr>
</table>
無記錄:將標籤值轉換成databounded gridview的
<asp:TextBox ID="txtNo" runat="server"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
<br />
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField HeaderText="Branch">
<ItemTemplate>
<asp:TextBox ID="txtBranch" runat="server" Height="18px" Width="72px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:TextBox ID="txtDate" Text="<%# System.DateTime.Now.ToString() %>" runat="server" Height="18px" Width="72px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SrNo">
<ItemTemplate>
<%# Container.DataItemIndex + 1 %>
</ItemTemplate>
</Columns>
</asp:GridView>
//現在什麼我不能做的就是我想提出一個拉布勒值放入// GridView中的文本框label(lbl_sal)向我顯示我想將其值放入// textbox(TextBox ID =「BranchName」)的分支。有沒有辦法
沒有文本框'BranchName' – 2015-03-13 09:28:44
是您的GridView顯示正確地textBox中?有沒有'數據源'它? – zey 2015-03-13 09:29:32
@TimSchmelter,我認爲它是'txtBranch' :) – zey 2015-03-13 09:29:58