<html>
<head>
    <title>Call Server side Button event using JQuery</title>
     src="scripts/jquery-1.4.1.min.js" type="text/javascript">
     type="text/javascript">
        $(document).ready(function () {
            $("#lnkbtn").click(function () {
                $("#<%=Button1.ClientID %>")[0].click(); }); }); 
</head> 
<body>  
   <form id="form1" runat="server"> 
     <a id = "lnkbtn" href = "#">Click</a> 
     <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> 
   </form> 
</body> 
</html>
Advertisements

Month_Between function in oracle is used for calculating Year, Month & Days

select    trunc (months_between (end_date, start_date) / 12)
|| ‘ Years ‘ 

       || mod (trunc (months_between (end_date, start_date)), 12)
       || ‘ Months ‘
       || (  to_date (end_date)
           – add_months (start_date,
                         trunc (months_between (end_date, start_date))
                        )
          )
       || ‘ Days’
  from dual;

In ConfirmButtonExtender, We can use   character code to break line & put remaining character in new line.

Example :

<cc1:ConfirmButtonExtender ID=”cbeDelete” runat=”server” ConfirmText=“Before submitting your Application, Verify all filled details in the application. If you want to Submit your Application, Click on OK button.”
TargetControlID=”btnsubmit”>

 

If you like this post, pls leave your valuable comment.

Method : 1 (Using CSS)

<style>
tr:nth-child(even)
{
background: #E3F3FB;
color:Black;
}
tr:nth-child(odd)
{
background: #FFF;
color:Black;
}

tr:hover
{
background: #FFFFCB;
cursor: hand;
font-weight:bold;
color:Black;
cursor:pointer;
}
</style>

 

<table width=”100%” cellspacing=”0″ cellpadding=”0″ style=”border: none; border-collapse: collapse;”
border=”0″ id=”tbl”>
<tr style=”background-color: #294E79; color: White; text-align: center”>
<td style=”border: none; font-family: Arial” width=”5%”>
Sr No.
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
Heading1
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
Heading2
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
&nbsp;
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
1
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”lbl1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
2
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”Label1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
</table>

 

Method : 2 (Using Jquery & CSS)

 

$(document).ready(function () {
$(‘#tbl tr:has(td)’).mouseover(function () {
$(this).addClass(“initial”);
});
$(‘#tbl tr’).mouseout(function () {
$(this).removeClass(“highlight”);
})
})

<style>
.initial
{
background-color: red;
color: #000000;
}
.normal
{
background-color: #CCCCCC;
}
.highlight
{
background-color: #8888FF;
}
</style>

<table width=”100%” cellspacing=”0″ cellpadding=”0″ style=”border: none; border-collapse: collapse;”
border=”0″ id=”tbl”>
<tr style=”background-color: #294E79; color: White; text-align: center”>
<td style=”border: none; font-family: Arial” width=”5%”>
Sr No.
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
Heading1
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
Heading2
</td>
<td style=”border: none; font-family: Arial” width=”10%”>
&nbsp;
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
1
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”lbl1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
<tr>
<td style=”border: none; font-family: Arial; text-align: center” width=”5%”>
2
</td>
<td style=”border: none; font-family: Arial” width=”50%”>
<asp:label runat=”server” id=”Label1″ text=”TEXT2″></asp:label>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
<a href=”pdf file link” target=”_blank”>
<img src=”images/pdf.png” width=”20px” height=”20px” /></a>
</td>
<td style=”border: none; font-family: Arial; text-align: center” width=”10%”>
</td>
</tr>
</table>

If you want to apply condition base formatting in crystal report, you can use below method for that.

if (IsNumeric({Student.Marks})) Then
if({Student.Marks} >= 40) then
crbold   //font bold – PASS
else
crregular //font regular – FAIL
else
crregular //if non-numeric/empty/NULL make the font regular – FAIL
=============================================================
To change the font style dynamically according to value, use this expression in your expression

=Format(First(Fields!Field_value.Value, “ABCDEFG”),”BOLD”)

Solution : 1

TemplateField with Hyperlink and img Element

<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink runat=”server” NavigateUrl='<%# Eval(“PAGE_Or_PDF_URL”) %>’
Target=”_blank”>
<img src='<%# Eval(“Image_URL”) %>’ alt=”PDF IMAGE” />
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

Solution : 2
TemplateField with ImageButton

<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton runat=”server” ImageUrl='<%# Eval(“Image_URL”) %>’
PostBackUrl='<%# Eval(“Target_URL”) %>’ AlternateText=”Alternate Text” />
</ItemTemplate>
</asp:TemplateField>
Solution : 3

TemplateField with Javascript
<asp:TemplateField>

<asp:ImageButton ID=”ImageButton1″ runat=”server” ImageUrl='<%# Eval(“Image_URL”) %>’ OnClientClick='<%# String.Format (“javascript:return openTargetURL(\”{0}\”)”, Eval(“Target_URL”)) %>’ AlternateText=”Alternate Text” />

</asp:TemplateField>

For VB.NET
For Each vValidator As BaseValidator In Page.Validators
vValidator.Enabled = False
Next
For C#
foreach (BaseValidator vValidator in Page.Validators)
{
vValidator.Enabled = false;
}