.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

please correct this code

Posted By: kavitha     Posted Date: November 16, 2010    Points:2   Category :ASP.Net
hi friends,

if i Move the cursor in body of gridview show the hyperlink in runtime,

please correct this code.

thanks in advance.


This is the code:

<html>
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function fun(showhide)
{
var lnk = document.getElementById('HyperLink1');
lnk.style.display = showhide;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onmouseover="fun('block');" onmouseout="fun('none');">
<Columns>
<%-- GridView Contnets goes here --%>
</Columns>
</asp:GridView>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="http://www.google.com" style="display:none">HyperLink</asp:HyperLink>
</div>
</form>
</body>
</html>

Responses
Author: Dhivakaran             
Posted Date: November 22, 2010     Points: 5   

Hi

Use the below codes,

you can do this CSS style.

<asp:GridView ID="grdData" BorderColor="Black" runat="server" AutoGenerateColumns="False" >

<Columns>
<asp:TemplateField HeaderText="Qustion">
<ItemStyle Width="60px"/>
<ItemTemplate>
<a href='www.google.com'>
<asp:Label ID="lblTitle" runat="server" CssClass="grdtextlink" ToolTip="View" Text='<%#Eval("data")%>'></asp:Label> </a>
</ItemTemplate>
</asp:TemplateField>

</Columns>
</asp:GridView>

and use the below css code.

.grdtextlink
{
font-family:Tahoma,Verdana,Arial,Helvetica,sans-serif;
font-size: 10pt;
color:Black;
line-height:16px;
font-style: normal;
text-decoration: none;

}
.grdtextlink:hover
{
font-family:Tahoma,Verdana,Arial,Helvetica,sans-serif;
font-size: 10pt;
color:Red;
line-height:16px;
font-style: normal;
text-decoration: none;

}

-
Dhivakaran T


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend