hyperlink in in checkboxfield detailsview
In my detailsview control, i have several checkedboxfield with boolean = true. What I want have hyperlink on any text such as HeaderText of the datafield in order to navigate to other page. Is it possible? If not, any suggestion?
For mode details, When click the hyperlink in gridview, the detailsview will show the details which checkbox will checked if boolean=true and unchecked if false. I want to have hyperlink text on Checked CheckedBoxField (Unchecked Checkbox I hide it by code behind).
Below is the aspx:
`
<Fields>
<asp:CheckBoxField DataField="Sample_Preparation_SP" HeaderImageUrl="~/Images/Coal/Coal.jpg"
HeaderText="Sample_Preparation" Text="Sample_Preparation" />
<asp:CheckBoxField DataField="Free_Moisture_FM" HeaderImageUrl="~/Images/Biomass/Wood Chips.jpg"
HeaderText="Free_Moisture_FM" SortExpression="Free_Moisture_FM" Text="Free Moisture" />
<asp:CheckBoxField DataField="Inherent_Moisture_IM" HeaderImageUrl="~/Images/Coal/Coal.jpg"
HeaderText="Inherent_Moisture_IM" SortExpression="Inherent Moisture" Text="Inherent Moisture" />
<asp:CheckBoxField DataField="Total_Moisture_TM" HeaderText="Total_Moisture_TM" SortExpression="Total_Moisture_TM" HeaderImageUrl="~/Images/Biomass/Wood Pellet3.jpg" Text="Total Moisture" />
<asp:CheckBoxField DataField="Gross_Calorific_Value_GCV" HeaderText="Gross_Calorific_Value_GCV"
SortExpression="Gross_Calorific_Value_GCV" HeaderImageUrl="~/Images/Biomass/EFB.jpg" Text="Gross Calorific Value" />
<asp:CheckBoxField DataField="Net_Calorific_Value_NCV" HeaderText="Net_Calorific_Value_NCV" SortExpression="Net_Calorific_Value_NCV" HeaderImageUrl="~/Images/Biomass/Wood Chips.jpg" Text="Net Calorific Value" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
SelectCommand="SELECT [SampleID],[Sample_Preparation_SP], [Free_Moisture_FM], [Inherent_Moisture_IM], [Total_Moisture_TM] ,[Gross_Calorific_Value_GCV], [Net_Calorific_Value_NCV] FROM [tbl_SampleRegistration] WHERE SampleID =@SampleID" >
<SelectParameters>
<asp:QueryStringParameter Name="SampleID" QueryStringField="SampleID" />
</SelectParameters>
</asp:SqlDataSource>`
The best way is to use Template Fields for Details View so you can customise things to any level.
See this excellent link from MSDN
http://msdn.microsoft.com/en-us/library/bb288033.aspx
链接地址: http://www.djcxy.com/p/30998.html
上一篇: 通过点击表格行来调用代码