Happy New Year-2013


Happy New Year-2013

Advertisements

list of Jobs Websites for Freshers and Experienced Job Seekers


Naukri (www.naukri.com/)
Monster India (www.monsterindia.com/)
Chetanas (www.chetanasforum.com/)
Times Jobs (www.timesJobs.com/)
Durga Jobs(www.durgajobs.com/)
Jobstreet (www.jobstreet.co.in/)
Govtjobsdaily (www.govtjobsdaily.com/)
FreshersCafe(www.fresherscafe.com/)
FreshersWorld(www.jobs.freshersworld.com/)
Careerbuilder (www.careerbuilder.co.in/)
Careerjet (www.careerjet.com/)
Naukri Hub (www.naukrihub.com/)
Career India (www.careerindia.com/)
Bestjobsindia (www.bestjobsindia.in/)
Careesma (www.careesma.in/)
AllFreshersWorld(www.allfreshersworld.com/)
Bixee (www.bixee.com/)
WisdomJobs (www.wisdomjobs.com/)
ClickJobs (www.clickJobs.com/)
CareerAge (www.careerAge.com/)
Freshersworld (www.freshersworld.com/)
FreshersHome(www.freshershome.com/)
Topindiajobs (www.topindiajobs.com/)
Placement India (www.placementindia.com/)
Shine (www.shine.com/)
careesma(www.careesma.in/)
ApnaCircle (www.apnacircle.com/)

how to Check whether entered value in textbox is string or integer in asp.net c#?


Sometimes we need to know entered value is string or integer we can use int.TryParse method…
How to use int.TryParse method:
it will take one input and output variables and it returns bool(if int returns true else false)

Code in .aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="IntorNot.aspx.cs" Inherits="IntorNot" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head runat="server">
    <title>Int or Not</title>
   
    <style type="text/css">
        .style1
        {
            font-weight: bold;
        }
    </style>
   
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    </td>
                <td>
                    <asp:Button ID="Button1" runat="server" Text="Integer or not"
                        onclick="Button1_Click" />
                    </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" CssClass="style1" style="color: #009900"></asp:Label>
                    <asp:Label ID="Label2" runat="server" CssClass="style1" style="color: #CC0000"></asp:Label>
                    </td>
                <td>
                    
                    </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>

Code in .aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class IntorNot : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(TextBox1.Text))
        {
            int EnteredIntValue = 0;
            bool IsIntOrNot = false;
            IsIntOrNot = int.TryParse(TextBox1.Text, out EnteredIntValue);
            if (IsIntOrNot)
            {
                Label1.Text = "Yes, You Entered " + EnteredIntValue.ToString() + " is an Integer";
                Label2.Text = string.Empty;
            }
            else
            {
                Label2.Text = "No, You Entered " + TextBox1.Text + " is Not an Integer";
                Label1.Text = string.Empty;
            }
        }
        else
        {
            Label2.Text = "Please Enter Something in textbox";
            Label1.Text = string.Empty;
        }
    }
}

Output:

it's an integer

 Not an integer

 Please enter something in textbox

How to append text to a Eval databound field in gridview in asp.net?


We will use Databinders to bind data to controls.

Sometimes we need to append some text before data or after data… ex: we can append Download text before to DocumentName

we can do this as follows

Append Text before Eval Data

  1. <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/DwonloadFile.png" ToolTip='<%#"Download" +" "+ Eval("DocumentName").ToString() %>'/>

Append Text before and after Eval Data

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/DwonloadFile.png" ToolTip='<%#"Download" +" "+ Eval("DocumentName").ToString()+" "+ "TextFile"%>'/>

Concatenating Two Eval binders

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/DwonloadFile.png" ToolTip='<%#"Download" +" "+ Eval("DocumentName").ToString()+" as "+ Eval("Format").ToString()%>'/>

By using string.Format() Method in Eval

Append Text before Eval Data

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/DwonloadFile.png" ToolTip='<%#string.Format("Download {0}",Eval("DocumentName")) %>'/>

Append Text before and after Eval Data

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/DwonloadFile.png" ToolTip='<%#string.Format("Download {0} as TextFile",Eval("DocumentName")) %>'/>

Concatenating Two Eval binders

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/DwonloadFile.png" ToolTip='<%#string.Format("Download {0} as {1}",Eval("DocumentName"),Eval("Format")) %>'/>

Thanks…

Venki

Hi if this is not solving ur problem please leave ur requirement as a comment below this post…