DataControlField.HeaderImageUrl Property
.NET Framework 3.0
Gets or sets the URL of an image that is displayed in the header item of a data control field.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public: virtual property String^ HeaderImageUrl { String^ get (); void set (String^ value); }
/** @property */ public String get_HeaderImageUrl () /** @property */ public void set_HeaderImageUrl (String value)
public function get HeaderImageUrl () : String public function set HeaderImageUrl (value : String)
Not applicable.
Property Value
A string that represents a fully qualified or relative URL to an image that is displayed in the header item of the DataControlField.Set the HeaderImageUrl property when you want an image displayed in the header item of a data control instead of header text.
Note: |
|---|
| If both the HeaderText and HeaderImageUrl properties are set, the HeaderImageUrl property has precedence. |
The following code example demonstrates how to declaratively set the HeaderImageUrl property of a ButtonField column, which displays an image in the GridView control's column header instead of header text.
<%@ page language="VJ#" %>
<!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>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:sqldatasource
id="SqlDataSource1"
runat="server"
connectionstring="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind"
selectcommand="Select EmployeeID, FirstName, LastName, Title, Region From Employees">
</asp:sqldatasource>
<asp:gridview
id="GridView1"
runat="server"
allowpaging="True"
datasourceid="SqlDataSource1"
allowsorting="True"
width="472px">
<columns>
<asp:buttonfield
headerimageurl="http://www.microsoft.com/homepage/gif/bnr-microsoft.gif"
text="ClickMe"
showheader="True"
buttontype="Button">
</asp:buttonfield>
<asp:hyperlinkfield
target="http://msdn.microsoft.com/"
headertext="Link To Info"
text="MyLink">
<headerstyle backcolor="Yellow">
</headerstyle>
</asp:hyperlinkfield>
</columns>
</asp:gridview>
</form>
</body>
</html>
Community Additions
ADD
Show:
Note: