• 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


Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Friday, April 18, 2008

How to use Custom Validator in Asp.Net

How to use Custom Validator in Asp.Net
---------------------------------------------------

This is the HTML section of Custom Validator Control.

<asp:CustomValidator ID="custVal" runat="Server" ValidationGroup="grpProductAdd"
Display="None" ErrorMessage="Please, Enter Product Amount." ClientValidationFunction="CheckProduct">
</asp:CustomValidator>

We need a javascript function to use Custom Validation that return either 'true' or 'false' result.

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

// You must use this both parameter with your function, because by it Validator validate the result.
function CheckProduct(sender, args)
{
// This is the variable name by which we can identify true/false result.
var Check = 0;


var ProductVal = document.getElementById('txtProductVal').value;
if (ProductVal = '')
{
Check = 0
}
else
{
Check = 1
}


// If your condition become true
if (Check == '0' )
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
</script>

That's It !
Hope you will like it.

Thursday, April 17, 2008

Javascript to dynamically add styles and event to form Element.

Javascript to dynamically add styles and event to form Element
=====================================================

<HTML>
<HEAD>

<style type="text/css">
.OnFocus
{
background-color : gray;
}
.OnBlur
{
background-color : white;
}
</style>

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

function SetStyle()
{
var elem = document.getElementById('frmMain').elements;

for(var i = 0; i < elem.length; i++)
{
// Assing style to each and every textbox on this page.
if (elem[i].type == "text")
{
elem[i].setAttribute("onfocus","this.className = 'OnFocus';");
elem[i].setAttribute("onblur","this.className = 'OnBlur';");
}
}
}

</script>
</HEAD>

<BODY onload="javascript:SetStyle()">
<form id="frmMain" >

<input type="text" value="Hello 1" id="text1" /> <br/>
<input type="text" value="Hello 1" id="text2" /><br/>
<input type="password" value="Hello 1" id="text1" /> <br/>

</form>
</BODY>
</HTML>

That's It !
Hope you will like it.

Friday, March 14, 2008

Check all checkbox within GridView or DataGrid in Asp.Net

Check all checkbox within GridView or DataGrid in Asp.Net
===================================================

Sometimes we need to handle functionality in our asp.net pages, like when a header
checkbox become selected, all checkbox within a GridView or DataGrid should become selected.
So here, this is the way, by it you can handle this types of functionality.

Suppose your page GridView layout is like:
-----------------------------------------------------

<asp:GridView ID="gvCompanyInvoiceList" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkAll" onclick="CheckAll(this);" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkgdApprove" onclick="CheckChanged(this);" runat="server" />
</ItemTemplate>
<HeaderStyle Width="5%" />

</asp:TemplateField>
</Columns>
</asp:GridView>

Use this script to handle checkbox functionalities.
---------------------------------------------------------------

<script type="text/javascript">
function CheckAll(checkAllBox)
{

var frm = document.form1;
var ChkState=checkAllBox.checked;
for(i=0; i< frm.length;i++)
{
e = frm.elements[i];
if(e.type=='checkbox' && e.name.indexOf('chkgdApprove') != -1)
e.checked= ChkState ;
}
}
function CheckChanged()
{
var frm = document.form1;
var boolAllChecked;
boolAllChecked=true;
for(i=0;i< frm.length;i++)
{
e=frm.elements[i];
if ( e.type=='checkbox' && e.name.indexOf('chkgdApprove') != -1 )
if(e.checked== false)
{
boolAllChecked=false;
break;
}
}
for(i=0;i< frm.length;i++)
{
e=frm.elements[i];
if ( e.type=='checkbox' && e.name.indexOf('chkAll') != -1 )
{
if( boolAllChecked==false)
e.checked= false ;
else
e.checked= true;
break;
}
}
}
</script>

That's it !
Hope you will like it.

Thursday, January 3, 2008

Fade Effects With Javascript

Fade Effects With Javascript
========================

Script
-------

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

var TimeToFade = 1000.0;

function fade(eid)
{
var element = document.getElementById(eid);
if(element == null)
return;

if(element.FadeState == null)
{
if(element.style.opacity == null
|| element.style.opacity == ''
|| element.style.opacity == '1')
{
element.FadeState = 2;
}
else
{
element.FadeState = -2;
}
}

if(element.FadeState == 1 || element.FadeState == -1)
{
element.FadeState = element.FadeState == 1 ? -1 : 1;
element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
}
else
{
element.FadeState = element.FadeState == 2 ? -1 : 1;
element.FadeTimeLeft = TimeToFade;
setTimeout("animateFade(" + new Date().getTime()
+ ",'" + eid + "')", 33);
}
}

function animateFade(lastTick, eid)
{
var curTick = new Date().getTime();
var elapsedTicks = curTick - lastTick;

var element = document.getElementById(eid);

if(element.FadeTimeLeft <= elapsedTicks)
{
element.style.opacity = element.FadeState == 1 ? '1' : '0';
element.style.filter = 'alpha(opacity = '
+ (element.FadeState == 1 ? '100' : '0') + ')';
element.FadeState = element.FadeState == 1 ? 2 : -2;
return;
}

element.FadeTimeLeft -= elapsedTicks;
var newOpVal = element.FadeTimeLeft/TimeToFade;
if(element.FadeState == 1)
newOpVal = 1 - newOpVal;

element.style.opacity = newOpVal;
element.style.filter =
'alpha(opacity = ' + (newOpVal*100) + ')';

setTimeout("animateFade(" + curTick
+ ",'" + eid + "')", 33);
}

</script>

</HEAD>

How to Use
---------------
You can use this JavsScript this way.
Suppose, Your HTML layout is like this :

<BODY>
<div id="fadeBlock" style="background-color:Lime;width:250px;
height:65px;text-align:center;">
<br />
I'm Some Text
</div>
<br />
<br />
<input type="button" onclick="fade('fadeBlock');" value="Go" />

</BODY>
</HTML>

Thursday, December 6, 2007

Use Regular Expression by JavaScript

Use Regular Expression by JavaScript
===============================

    1 function validateEmail()

    2     {

    3         // Value to Validate. Ex. Your EMail Address TextBox

    4         var EMailID = document.getElementById('txtEMail').value;

    5 

    6         // Here, we set the Expression to Validate the Value for EMail Address.

    7         var EMailValidate = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;

    8 

    9         // Test the Validator.

   10         if( EMailValidate.test(EMailID)) 

   11         {

   12             alert('Right Email Address.');

   13         }

   14         else

   15         {

   16             alert('Wrong Email Address.');

   17         }

   18     }    

Sunday, December 2, 2007

Use ICallbackEventHandler in Asp.Net 2.0

Use ICallbackEventHandler in Asp.Net 2.0
==================================

For Example, you have page Layout is like this :

<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<div id="divResult" runat="server">
</div>
<br/>
<input type="button" value="Text ICallBack" onclick="return GetPop()" />

</BODY>
</HTML>

Steps to Implement ICallbackEventHanler:
-------------------------------------------------

1. First define string variable in Common section of your code behind (.cs) file.

string _CallBackString;

2. Inherit ICallbackEventHandler in your page.

public partial class Customize : System.Web.UI.Page, ICallbackEventHandler

3. Now, write this code in your Page_Load() Event

ClientScriptManager cs = Page.ClientScript;

string cbRef = cs.GetCallbackEventReference(this, "arg", "ShowPop", "context");
string cbScript = "function CallPopBack(arg, context){" + cbRef + ";}";
cs.RegisterClientScriptBlock(this.GetType(), "CallPopBack", cbScript, true);

4. Now, Write some javascript code, in your design section of your page.

function GetPop()
{
var justExample = 'Hi..All..';

CallPopBack(justExample)
}
function ShowPop(result, context)
{

var strResult = new String();
strResult = result;

alert(result);
}

4. Now, In your code behind (.cs) file, write code for your EventHandle Method.

public string GetCallbackResult()
{
return _CallBackString;
}

public void RaiseCallbackEvent(string eventArgument)
{
_CallBackString = eventArgument + " " + DateTime.Now.ToShortTimeString();
}

5. Run the page and test this page.


Hope you will like it.

Tuesday, September 25, 2007

Javascript to Allow only numbers in TextBox

Javascript to Allow only numbers in TextBox
======================================

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

function CheckKeyCode(e)
{
if (navigator.appName == "Microsoft Internet Explorer")
{
if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode == 8))
{
return true;
}
else
{
return false;
}
}
else
{
if ((e.charCode >= 48 && e.charCode <= 57) || (e.charCode == 0))
{
return true;
}
else
{
return false;
}
}
}

</script>

// Add this code in your GridView control's RowDataBound Event.

((TextBox)e.Row.FindControl("txtDispOrder")).Attributes.Add("onkeypress", "javascript:return CheckKeyCode(event);");


Friday, March 9, 2007

Useful Javascript with Asp.Net

Open Popup Window in the Center of the screen.
=============================================
function OpenPop(ItemID)
{
var LeftPosition = (screen.width) ? (screen.width-505)/2 : 0;
var TopPosition = (screen.height) ? (screen.height-250)/2 : 0;

window.open('Pop_QuoteInfo.aspx?id='+
ItemID,'MyTitle','height=250,width=505, top='+ TopPosition +', left='+LeftPosition+', scrollbars=yes, resizable=yes, status=no');
}

Javascript Trim() Function
=========================

function trim(inputString) {
// Removes leading and trailing spaces from the passed string. Also removes
// consecutive spaces and replaces it with one space. If something besides
// a string is passed in (null, custom object, etc.) then return the input.
if (typeof inputString != "string") { return inputString; }
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") { // Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

How to set Default Button in Asp.Net
===============================

Just, Simply add this code to your page_load() event in code file.

txtUserID.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnLogin.UniqueID + "').click();return false;}} else {return true}; ");

Enable / Disable Validator Control by Javascript
========================================

function EnableDisableControl()
{
var ctl1 = document.getElementById('RequiredValidator1');

// Disable
ValidatorEnable(ctl1, false);

// Enable
ValidatorEnable(ctl1, true);
}

Set/Get value from Popup page and Parent Page
========================================

Get Value in Popup page from Parent Page
---------------------------------------------------
// Write this Javascript in Popup Page

var ParentIDValue = window.opener.document.getElementById('<Parent Page ID>').value;
alert(ParentIDValue);

Set Value in Parent Page from Popup Page
--------------------------------------------------

// Write this Javascript in Popup Page

window.opener.document.getElementById('<Parent Page ID>').value = "Your Value From Popup Page..";

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