• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

About me

Let me introduce myself


A bit about me

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Profile

Deepak Bhagya

Personal info

Deepak Bhagya

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.

Birthday: 21 SEP 1986
Phone number: +(12) 34 567 89
Website: www.dakshbhagya.com
E-mail: Me@dakshbhagya.com

RESUME

Know more about my past


Employment

  • 2015-future

    Mutation Media @ Web Developer

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2011-2014

    Websoham @ Exclusive Admin

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2009-2011

    Templateclue.com @ Lead Developer

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Education

  • 2015

    University of Engineering @Level

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2013-2014

    College of Awesomeness @ passed

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2009-2013

    College of Informatics @ graduated

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Skills & Things about me

photographer
86%
html & css
Punctual
91%
illustrator
Web Developer
64%
wordpress

Portfolio

My latest projects


Tuesday, May 6, 2008

Use Custom paging for DataList, GridView in Asp.Net

Use Custom paging for DataList, GridView in Asp.Net

Use Custom paging for Datalist, GridView in Asp.Net
=============================================

Suppose your HTML layout is like;
------------------------------------------

// Stylesheet
/* Start Pager 2 style */
.Pager2 { border-collapse:collapse;}
.Pager2 a { color:#0080C0; font-weight:bold; margin:1px; padding:2px 5px; border:1px solid white; text-decoration:none }
.Pager2 a:hover { color:White; font-weight:bold; border:1px #0080C0 solid; background-color:#0080C0 }
.Pager2 span { margin:1px; padding:2px 5px; background-color:#0080C0; color:White; border:1px #0080C0 solid}
/* End Pager 2 style */

// Page HTML layout
<div>
Name : <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btnGo_Click" />

<asp:DataList ID="dlCompanylist" RepeatColumns="1" RepeatDirection="Horizontal" runat="server">
<ItemTemplate>
<table width="200px" cellpadding="1" cellspacing="1" style="border-collapse:collapse">
<tr>
<td valign="top" style="width:100px">ID :</td>
<td><%#Eval("ID").ToString() %></td>
</tr>
<tr>
<td valign="top" >Name</td><td><%#Eval("Name").ToString() %>
</td>
</tr>
<tr>
<td valign="top">Date</td>
<td><%#Eval("RegisterDate").ToString() %></td>
</tr>
<tr>
<td colspan="2" style="border-bottom:solid 1px gray"> </td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<br />
<asp:Literal ID="ltPaging" runat="server"></asp:Literal>
</div>

// Javascript Method
<script language="javascript" type="text/javascript">

function next_prev_page(val)
{

location.href = "zzCustomPaging.aspx?page=" + val;


}
</script>

// Code Behind Part
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.BindGrid();
}
}

private void BindGrid()
{
Company objCompany = new Company();

objCompany.name = txtName.Text.Trim();
objCompany.status = 3;
objCompany.SortBy = "Name";
objCompany.SortOrder = SortDirection.Ascending;
objCompany.PageNo = Request.QueryString["Page"] != null ? int.Parse(Request.QueryString["Page"].ToString()) - 1 : 0;
objCompany.PageSize = 5;

DataSet dsCompanyList = objCompany.GetCompanyRegisterListAll();

if (dsCompanyList != null && dsCompanyList.Tables[0].Rows.Count > 0)
{
dlCompanylist.DataSource = dsCompanyList.Tables[0];
dlCompanylist.DataBind();

ltPaging.Text = this.Paging(objCompany.PageNo + 1, int.Parse(dsCompanyList.Tables[1].Rows[0][0].ToString()), objCompany.PageSize);
}
}


private string Paging(int Page, int TotalRecords, int PageSize)
{
int PageNo = 0;
string NextPage = "";
string PreviousPage = "";
string Print = "";
string Range = "";
string Pager = "";

int Start = 0;
int StartRange = 0;
int EndRange = 0;

if (TotalRecords > PageSize)
{
double RecordForPaging = Math.Ceiling((Convert.ToDouble(TotalRecords) / Convert.ToDouble(PageSize)));
double RecordPage, v;
int NewNo;

if (RecordForPaging > Math.Floor(RecordForPaging))
{
RecordPage = (Math.Floor(RecordForPaging)) + 1;
}
else
{
RecordPage = RecordForPaging;
}

if (RecordPage <= PageSize)
v = RecordPage;
else
v = 5;

if (Page != 1)
PreviousPage = "<div class='Pager2'><a href=javascript:next_prev_page(" + (Page - 1) + ");>PREVIOUS</a></div>";
else
PreviousPage = "";

if (Page != RecordPage)
NextPage = "<div class='Pager2'><a href=javascript:next_prev_page(" + (Page + 1) + ");>NEXT</a></div>";

Print = "";

if (Page == 1)
{
for (PageNo = 1; PageNo <= v; PageNo++)
{
if (RecordPage >= PageNo)
{
if (PageNo == Page)
{
Print += " <b class='Pager2'><span>" + PageNo + "</span></b>";
}
else
{
Print += " <b class='Pager2'><a href=javascript:next_prev_page(" + PageNo + ");>" + PageNo + "</a></b>";
}
}
}
}
else if (Page <= RecordPage)
{
if (PageNo <= RecordPage)
NewNo = 2;
else
NewNo = Page - 5;

if (PageNo <= RecordPage)
NewNo = Page - 5;


for (PageNo = NewNo; PageNo <= Page + 5; PageNo++)
{
if (PageNo > 0)
{
if (PageNo == Page)
Print += " <b class='Pager2'><span>" + PageNo + "</span></b>";
else
{
if (PageNo <= RecordPage)
Print += " <b class='Pager2'><a href=javascript:next_prev_page(" + PageNo + ");>" + PageNo + "</a></b>";
}
}
}
}

Start = (Page - 1) * PageSize;
StartRange = Start + 1;
EndRange = Start + PageSize;

if (EndRange >= TotalRecords)
EndRange = TotalRecords; //end display
Range = StartRange + "-" + EndRange + " of " + TotalRecords;
Pager = "<table width='100%' border='0' style='border-collapse:collapse' ><tr><TD ALIGN='right' width='20%'><TABLE border='0'><TR>";
Pager += "<td width='70px'>" + PreviousPage + "</td><td NOWRAP width='200px'> <div>" + Print + " </div></td><td NOWRAP width='70px' align='left'>" + NextPage + "</td>";
Pager += "</TR></TABLE></TD><td WIDTH='80%' ><div align='left'>" + Range + "</div></td>";
Pager += "</td></tr></table>";
return Pager;
}

return string.Empty;
}


That's It !
Hope you will like it.

Friday, May 2, 2008

Use Dynamic stylesheet class for messages in Asp.Net

Use Dynamic stylesheet class for messages in Asp.Net

Hi,

In the web application, some times we need to use a message style for
only one Label, like, suppose if our data has been added successfully, we display
message like 'Records has been added successfully'. So, depend on
system's different situation, we have to display label message with style color
combination.

So, Here you can find the solution. By it, you can display your message
with sytle as per your system's situation.

Just copy and paste the style script and copy C# method in your page.

You can find it here...

<style type="text/css">

.MessageSuccess
{
background: #EFF4EA url(images/icn_successful.gif) center no-repeat;
background-position: 15px 5px; /* x-pos y-pos */
font-weight:bold;
text-align: left;
padding: 5px 20px 5px 45px;
border-top: 1px solid #1E8B18;
border-bottom: 1px solid #1E8B18;
color:#555555;

}
.MessageInfo
{
background: #FFFFD2 url(images/icn_info.gif) center no-repeat;
background-position: 15px 5px; /* x-pos y-pos */
text-align: left;
font-weight:bold;
padding: 5px 20px 5px 45px;
border-top: 1px solid #CACA00;
border-bottom: 1px solid #CACA00;
color:#555555;

}
.MessageError
{
background: #FFEAEA url(images/icn_error.gif) center no-repeat;
background-position: 15px 5px; /* x-pos y-pos */
text-align: left;
font-weight:bold;
padding: 5px 20px 5px 45px;
border-top: 1px solid #FF6F6F;
border-bottom: 1px solid #FF6F6F;
color:#555555;

}
</style>

(Download these images for stylesheet)




<form id="form1" runat="server">
<asp:Label ID="lblMessage" runat="server" />
</form>

protected void Page_Load(object sender, EventArgs e)
{
lblMessage.Text = "Records has been Added Successfully.";
this.SetStyle(lblMessage, MessageType.Info);
}

private void SetStyle(Label objLabel, MessageType msgType)
{
if (string.IsNullOrEmpty(objLabel.Text.Trim()))
objLabel.CssClass = "";
else
{
switch (msgType)
{
case MessageType.Error:
objLabel.CssClass = "MessageError";
break;
case MessageType.Info:
objLabel.CssClass = "MessageInfo";
break;
case MessageType.Success:
objLabel.CssClass = "MessageSuccess";
break;
}
}
}

// Define enum in the outer side of your page class.
public enum MessageType
{
Success,
Info,
Error
}

Now, Run your page and check it.

That's it !
Hope you will like it.

Services

What can I do


Branding

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Web Design

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque.

Graphic Design

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Development

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Photography

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

User Experience

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com