2017-02-18
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="sn" OnRowCommand="GridView1_RowCommand" AllowSorting="True" AutoGenerateColumns="False" OnRowUpdating="GridView1_RowUpdating" OnDataBound="GridView1_DataBound"> <Columns> <asp:TemplateField HeaderText="電子郵件" SortExpression="useremail"> <EditItemTemplate> <asp:TextBox ID="TextBox_useremail" runat="server" Text='<%# Bind("useremail") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label_useremail" runat="server" Text='<%# Bind("useremail") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> |
改為
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="sn"
OnRowCommand="GridView1_RowCommand" AllowSorting="True" AutoGenerateColumns="False"
OnRowUpdating="GridView1_RowUpdating" OnDataBound="GridView1_DataBound">
<Columns>
<asp:TemplateField HeaderText="電子郵件" SortExpression="useremail">
<EditItemTemplate>
<asp:TextBox ID="TextBox_useremail" runat="server" Text='<%# Bind("useremail") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:HyperLink ID="HyperLink_useremail" NavigateUrl='<%# Bind("useremail", "mailto:{0}") %>' Text='<%# Bind("useremail") %>' runat="server"></asp:HyperLink>
<%--<asp:Label ID="Label_useremail" runat="server" Text='<%# Bind("useremail") %>'></asp:Label>--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
|
(完)
沒有留言:
張貼留言