Wednesday 16 May 2012

Find Control in Page of Master Page

   

 ContentPlaceHolder mpContentPlaceHolder;
        TextBox mpTextBox;
// MainContent is content place holder name
        mpContentPlaceHolder =
            (ContentPlaceHolder)Master.FindControl("MainContent");
        if (mpContentPlaceHolder != null)
        {
            string str = "txtFirstName";
            TextBox txt = (TextBox)this.Master.FindControl(str);
            Response.Write(txtFirstName.Text);
        }

Find Total Time of Wav file in asp.net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using NAudio.Wave;


protected void Button1_Click(object sender, EventArgs e)
    {
string strFilename = "10kHz_44100Hz_16bit_30sec.wav" ;
        WaveFileReader wf = new WaveFileReader(Server.MapPath(strFilename));
       string strTime =  wf.TotalTime.ToString();
       Response.Write(strTime);
    }

Download load NAudio.dll from following url
http://naudio.codeplex.com/

Tuesday 15 May 2012

Jquery Tutorials Step by Step


What is jQuery :

jQuery is a JavaScript Library.

What You Should Already Know

Before you start studying jQuery, you should have a basic knowledge of:
  • HTML
  • CSS
  • JavaScript

What is jQuery?

jQuery is a library of JavaScript Functions.
jQuery is a lightweight "write less, do more" JavaScript library.
The jQuery library contains the following features:

  • HTML element selections
  • HTML element manipulation
  • CSS manipulation
  • HTML event functions
  • JavaScript Effects and animations
  • HTML DOM traversal and modification
  • AJAX
  • Utilities
You can do this by downloading jQuery from their website at www.jquery.com. There is usually a choice between a "Production" version and a "Development" version. The first is for your live website, because it has been minified and compressed to take up the least amount of space, which is important for your visitors, whose browser will have to download the jQuery file along with the rest of your website. For testing and development, the "Development" version is best. It hasn't been minified or compressed, so when you run into an error, you can actually see where in jQuery it happens. 


Adding the jQuery Library to Your Pages

 <head>
        <title>jquery Tutorial</title>
        <script type="text/javascript" src="jquery-1.5.1.js"></script>
</head>

A more modern approach, instead of downloading and hosting jQuery yourself, is to include it from a CDN (Content Delivery Network). Both Google and Microsoft host several different versions of jQuery and other JavaScript frameworks. It saves you from having to download and store the jQuery framework, but it has a much bigger advantage: Because the file comes from a common URL that other websites may use as well, chances are that when people reaches your website and their browser requests the jQuery framework, it may already be in the cache, because another website is using the exact same version and file. Besides that, most CDN's will make sure that once a user requests a file from it, it's served from the server closest to them, so your European users won't have to get the file all the way from the US and so on. 

You can use jQuery from a CDN just like you would do with the downloaded version, only the URL changes. For instance, to include jQuery 1.5.1 from Google, you would write the following:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> 


I suggest that you use this approach, unless you have a specific reason for hosting jQuery yourself

The ready event

It's good practice to wait for the document to be fully loaded and ready, before working with it. This also allows you to have your JavaScript code before the body of your document, in the head section, either directly or through a link to an external JavaScript file. You may do just that by placing your code inside the document ready event. We will use the same example as in the "Hello, world!" chapter, but this time the code is inside the ready event:<script type="text/javascript">
function DocumentReady()
{
        $("#divTest1").text("Hello, world!"); 
}

$(document).ready(DocumentReady);
</script>

What we do here is that we create a function, called DocumentReady, which should be fired as soon as the document is ready for DOM manipulation. In the last line, we use the ready() method to assign our function to the ready event, to tell jQuery that as soon as the document is ready, we want it to call our function. 

However, we can shorten this a bit by using an anonymous function of JavaScript instead. This basically just means that instead of declaring the function and giving it a name, we simply create it and then immediately passes the reference to the ready() function. If you're new to JavaScript, then this might seem overly complicated, but as you get used to it, you might appreciate the fewer keystrokes and the less space needed to accomplish the same:

<div id="divTest2"></div>
<script type="text/javascript">
$(document).ready(function()
{
        $("#divTest2").text("Hello, world!"); 
});
</script>

But of course, this wasn't even short enough for the jQuery team, so they decided to create a version (overload) of the jQuery constructor which takes a ready function as a parameter, to make it even shorter:

<div id="divTest3"></div>
<script type="text/javascript">
$(function()
{
        $("#divTest3").text("Hello, world!");  
});
</script>

In the last example, our anonymous function is passed directly to the jQuery constructor, which assigns it to the ready event. As you will see when you test the code, the event is fired as soon as the page is loaded, most of the time so fast that you won't even realize it.

As already described, wrapping your code in the ready event function is best practice for working with jQuery in your document 

Method chaining

 Yet another one of the really cool aspects of jQuery is the fact that most of the methods returns a jQuery object that you can then use to call another method. This allows you to do command chaining, where you can perform multiple methods on the same set of elements, which is really neat because it saves you and the browser from having to find the same elements more than once. Here's an example, and don't worry about the jQuery methods used in the following examples - they will be explained in later chapters:
Try this example
<div id="divTest1"></div>
<script type="text/javascript">
        $("#divTest1").text("Hello, world!").css("color", "blue");
</script>
It works like this: We instantiate a new jQuery object and select the divTest1 element with the $ character, which is a shortcut for the jQuery class. In return, we get a jQuery object, allowing us to manipulate the selected element. We use that object to call the text() method, which sets the text of the selected element(s). This method returns the jQuery object again, allowing us to use another method call directly on the return value, which is the css() method.

We can add more method calls if needed, but at some point, the line of code will become quite long. Fortunately for us, JavaScript is not very strict when it comes to the syntax, so you can actually format it like you want, including linebreaks and indentations. For instance, this will work just fine as well:
Try this example
<div id="divTest2"></div>
<script type="text/javascript">
        $("#divTest2").text("Hello, world!")
                                        .removeClass("blue")
                                        .addClass("bold")
                                        .css("color", "blue");                                
</script>
JavaScript will simply throw away the extra whitespace when interpreting the code and execute it as one long line of code with several method calls.

Note that some methods doesn't return the jQuery object, while others only return it depending on the parameters you pass to it. A good example of that is the text() method used above. If no parameters are passed to it, the current text of the selected element(s) is returned instead of a jQuery object, while a single parameter causes jQuery to set the specified text and return a jQuery object. 

My Best Quotes

A successful man is one who can lay
A firm foundation with the bricks that
Others throw at him.
Good Luck!

The Hope, the Struggle and the Hard Work
Towards a goal is part of the rewards.
Achieving goal itself is not the whole reward
Good Luck!

We Believe Good luck Will Do Someday,
Something For Us...
But
We Don't Know Good luck Is Also Waiting
That We Do Something, Someday.


Love yourself first
and
everything else falls into line.
You really have to love yourself
to get anything done in this world.
Good Luck

Ru hungry?Nevr mind I hv 2 bowls,1 for wishes
and 1 for luck.Wishes are mine and luck is yours. you can take it or leave it, choice is urs


Success is never permanent.
Failure is never final.
so always do not stop effort
until your victory makes a history.
Good luck

Good luck is a lazy man's estimate of a worker's success. Keep working B lucky!

It's not important 2 go 2 Heaven after we leave. But it's important 2 create Heaven in someone's heart b4 we leave.


Be with someone who knows exactly what they have when they have you. Not someone who'll realize it, when they've lost you!


Life isnt about waiting for the storm to pass, its about learning to dance in the rain.

Trust is like an eraser;
It gets smaller after each mistake.

Choose a job you love, and you will never have to work a day in your life.

One of the basic differences between God and humans is:
God gives, gives and forgives. But human gets, gets & forgets. Be thankful in life!



The problem with the world is that the intelligent people are full of doubts while the stupid ones are full of confidence.


All beautiful relationships do not depend on how well we understand someone but it depends on how well we manage the misunderstandings.

Common sense is not a gift, it's a punishment because you have to deal with everyone who doesn't have it.

Math may not teach me how to add love or subtract hate, but it gives me every reason to hope that every problem has a solution.

Forgiving people who have hurt you is your gift to them.
Forgetting people who have hurt you is your gift to you.

God has given us brain to store good things in its hard disk , leave no space for junk or bad viruses!

If you stand for a reason, stand like a tree. If you fall on the ground, fall like a seed that grows back to fight again.

Its so important to make someone happy. Start with yourself.



Time can turn at any time, dont devalue anyone in life. We may be powerful but time is more powerful than us!

When you work, dont expect your talent to be discovered. Work hard because it makes you happy.

A relationship vthout trust is like mobile vth no service.
n wat do u do vth mobile vth no service?
U play games.


Our heart is the greatest cheater in the world;
It makes thousands of different excuses to stay in touch with the people we love!


Difference between Truth & Lie. Truth is a Debit Card, pay first & enjoy late. While Lie is a Credit Card, enjoy first & pay later.


Imagination is more important than knowledge.

Maturity is not when we start speaking big things. It is when we start understanding small things!

Courage & Dedication brings you to the Top Of the World

Ignore the people who r always talking behind ur back. Tats wher they belong, just behind and making you famous.


The happiest people dont have the best of everything, they just make the best of everything.

Never feel all doors are closed in your life. All doors may not be locked, they may be waiting for ur gentle push.


Sometimes, you need to step outside, get some air and remind yourself of who you are and who you want to be.

Dont keep ur dreams in your eyes,they may fall as tears.Keep them in ur heart so that every heart beat can remind u abt them.


Life Can Give Us Number Of Beautiful Lovers
But
Only True Lover Can Give Us Beautiful Life


Some times silence is a very powerful tool
for making others feel for their mistakes

A little ignorance can hurt you a lot...
And can give u a Lifetime Experience...
Always love people from your heart...
Not from your mood

Dont Cry Over Someone That Wont Cry Over u
No Guy r Girl Is Worth ur Tears & Wen u Find
One That Is He r She Wont Make You Cry

True love doesnt have a happy ending:
True love doesnt have an ending.

Things that made me smile make me STRONG. Things that made me cry make me even STRONGER.

Expect but @ the same tym Efforts r needed for Achieve-Unknown

"To give real service, you must add something, which cannot be bought or measured with money."

"It is better to serve like steel than rust and wither away like iron."

"One man will be doing nothing. One man will be resting. Another man will be watching them. Yet another man will be helping these three."



"To give Real Love, you must add something, which cannot be bought or measured with money."

What should you required to learn machine learning

  To learn machine learning, you will need to acquire a combination of technical skills and domain knowledge. Here are some of the things yo...