Friday, September 21, 2012

Stylish iphone cases & covers price and photos

Best 10 iPhone 4 cases and covers design
Lets have a look over iPhone cases and covers frequently purchased & mostly demanded by the new generation [iPhone owners]. Here I am giving you brief detail with their images and latest price in the market. As I think so, everyone who want to buy a new iPhone OR have already also get exited to spent some more money for buying a spacial, featured, branded and attractive case for his iPhone for protection purpose.

Griffen Kazoo [Price-$24.99]
iphone cover & cases
Griffen Animal Parade [Price-$19.99]
iphone cases & covers


iLuv Camera Case [Price-$39.99]
iphone 4 cover & cases
iLuv Topog Mesh Softshell Case [Price-$29.99]
iphone 4 cases and covers


iLuv Festival Harshall case [Price-$29.99]
iphone 5 cases & covers
Giffen Wise Eyes [Price-$24.99]
Stylish iPhone cases photo


Belkin Sheild Spot [Price-$29.99]
Best iphone cover desine
Bubbles: Case Mate Creations [Price-$30]
Customized iPhone cases and covers


Griffen Chevron [Price-$24.99]
iphone cases price and cost


Case Mate Purple Glam [Price-$34.99]
How to purchase iphone cases and covers

Wednesday, September 19, 2012

Define page life cycle events with example in ASP .Net

Here You will get the solution of following queries:
Ques: What is page life cycle in asp .Net?
Ques: Describe events used in complete asp .net page life cycle.
Ques: Specify phase used in asp .Net page life cycle
Ques: Define Init, Load, Render and Unload events in page life cycle.

Today I want to share some knowledge about ASP .Net. Every developer who is working on ASP .Net must know about the Page life cycle[first step of web development using .Net technology]. Some of our friends after having 2-3 years of ASP .Net experience still don't have proper knowledge about all the events used in Page Life Cycle . As a developer I always got confused about page life cycle events in my beginning days, Here I am describing all the events with examples wherever applicable.

PreInit 
PreInit is the first phase in asp.net page life cycle events. This is the place where one can dynamically set their master page in the code. In such case you can also set any theme or skin to your page, in PreInit we can also set the properties of the server controls of Master page, like the code below:

protected void Page_PreInit(object sender, EventArgs e)
{
if (textBox1 == null)
       {
          Response.Write("Pre Init, server control Not available");
       }
       else
       {
          string TextinInit = textBox1.Text;
          Response.Write("Pre Init, Server Control enabled");
       }

Page.MasterPageFile = "~/TestInitMaster.master";

       TextBox _mstTextBox = (TextBox)Page.Master.FindControl("txtMessage");
       Label _mstLabel = (Label)Page.Master.FindControl("lblMessage");

       _mstLabel.Text = "Setted in default page at time : " +ateTime.Now.ToString();
       _mstTextBox.Text = "Textbox set in default page";
  }

In above you can see I’ve used a master page dynamically and set a label and TextBox’s Text property of that master page in runtime that means we can set the master page dynamically and associate the values in their controls if any. If you try to set the masterpage in any other event after Page_PreInit event, you will get an error message that will tell you that the master page only can be set on or before Page_PreInit event. In Page_PreInit event you can also see at the top level I’m checking a TextBox1 value whether it’s null or not. It is a server control (TextBox), but in PreInit the value will always be null of this text box or any other server control. So if I want to conclude the thing, in Page_PreInit controls are not fully initialized. So use this event for setting MasterPage file in your code. Each control Unique ID’s are also available at this event.

Init  
Init is called when you can initialize your page controls, this is the place that comes into picture after each Control initialization, till this event they get their Unique Id, master page etc. In Init you cannot access any controls properties after the last viewstate, I mean suppose you enter some text in a textbox control and click on a button control that makes a postback, now you want to view the value latest entered. In such case you will be able to see the textbox value which you’ve entered after the round trip happens, this is because of ViewState property of controls. That means they preserved your last saved value, but you see this value after Init phase because, usually we don’t use these events in our code and use just Page_Load event where the Viewstate value already got loaded. But as in Init phase, we cannot access our latest entered values in textbox, so in Init you won’t be able to get the latest changes. So I can say in Init we won’t be able to get the postback value.

InitComplete
In this event, Viewstate functionality is turned on for server control. Viewstate of controls allows preserving their values across postback.

PreLoad
This is the first event where viewstate functionality starts retrieving their values. PreLoad executes after InitComplete method. In this method, page has loaded values from viewstate. So for example in a button click event if you create a viewstate like below than what will going to be happen:

protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ViewState["myData"] = "just a text string";
        }

After button click, postback will happen at it will start calling page events like PreInit, Init, Initcomplete. Till these three events you will not be able to get the value of Viewstate “myData”. Even when the event fires PreLoad event of page, at this time you cannot access the ViewState, this is because ViewState will set the value when asp.net reaches the ButtonClick event, and this will happen after Load event, so one more time we will click on our submit button, and because now the ViewState[“myData”] resides into my page, I can access it on my PreLoad event. For better understanding please see the screen shot below:
ASP .Net page life cycle

Load
Most of the developers are familiar with the page load, as this is the only event that comes by default in aspx.cs page when you start doing anything with your code behind. The page Load events executes after the Page_PreLoad event. If you have created your own Load method in constructor of your code behing, then this will be the method that will execute before the Page_Load event and after Page_PreLoad event, for better understanding refer to the image below:
Init event in Page Life Cycle


As you are seeing in above code, I’ve created my own Page_Load event in my code behind as well as the default Load event, I didn’t mention Page_PreLoad event here, but it will execute after Page_InitComplete event. So back to the image, the _Default_Load will execute first before the Page_Load event. If you have any master page in your page, then the Load event of your master page will run followed by the user control Load event if they exist in your file.

Events
After the Page_load the next event is Page Control’s event. For example, if you have a control that raises postback just like button, and you clicked on the Button, so after Page_Load your Button_Click event will fire, and do the rest of the thing you’ve mentioned in your page. for better understanding please refer to the image below, event execution will be happen in that sequence how image is showing, in event portion whatever you will do that will go ahead and will do the things you’ve mentioned in you page. just like below, I said to create a ViewState[“myData”] and put some string inside that viewstate. So now the viewstate is ready to preserve ahead in my code. 

In Events you can also check the Page.IsValid property if you’ve used any validator controls in your page like regularexpressionValidator, requiredFieldValidator, Range etc. To check this property refer to the image below.
Load complete event of Page Life Cycle


LoadComplete
This event can be used when all the event processing has been done in the page.

PreRender/PreRenderComplete

PreRender event gets called when page has created all the controls that user will see in his browser. PreRenderComplete is the last place to change anything in the page. After this event any changes will not get preserved in page cycle. 

SaveStateComplete
event gets fired immediately after the PreRenderComplete event, in this event the viewstate functionality and control state get saved, as I said in PreRenderComplete changes can be done that will affect the next postback. In SaveStateComplete you can do the changes in your server control, but the state won’t be available in next postbacks. 

Render
Render is not an event but this is the phase where the HTML of your page will get rendered to the output stream with the help of HTMLTextWriter. You can override the Render method of page if you want to write your own code rather than the actual HTML text. As like below:

Render event of Page Life Cycle

As you can see in the code above, I’ve override the Render method in my code and write something with Heading 1 tag and later on called the base.render method. In current scenario the thing will happen is: apart my server controls code in my browser I’ll be able to see my Hello world text also. If I remove the base.render method calls, than I won’t be able to view my any control if I’ve created in page.


Unload 
This is the last event that gets fired. This is the page cleaning process like closing the open file connections etc, so in this process you cannot do any kind of manipulation with data that affect the rendering, you are restricted to use Response property also, and doing such you will get an exception message.

There might be some mistakes with this article but I tried my best to share with you, So if you have some queries OR suggestions please feel free and share the by comment. Thank you for reading this post..

Tuesday, September 18, 2012

How to disable Enter Key event JQuery java script

Disabling Enter Key press default form submission event using Jquery/Java Script

As we know that when we press Enter key the form automaticaly submited to the server. Some times we need to handle this situation and want to stop this automatic form submission. For this functionality we can disable Enter key 'KeyPress' event.

Ex-
function pageLoad()
{
     $('input').keypress(function(event) 
    {
         return event.keyCode == 13 ? false : true; 
    });
}

Description: Here we are working with keypress event over any input type and checking keyCode, if it is 13, means the user pressed 'Enter Key'. We can also use this keypress method inside the $(document).ready() function.

OR
$(document).ready(function() {
     $('input').keypress(function(event) 
    {
         return event.keyCode == 13 ? false : true; 
    });
});
 

Friday, September 14, 2012

How to make VoIP calls using Samsung Galaxy Phone


Samsung has a great image in the smartphone industry after producing mass friendly products like Galaxy phones. It deserve the no 1 position[on the basis of a consumer survey] in android market after launching a series of wonderful android phones and became the first choice for android loving fans. Samsung Galaxy Phones is the best one example of android community, which offer renowned capabilities and a lot of unique features from its competitors.
How to make VoIP calls using Samsung Galaxy Phone
VoIP is considered the main battlefield of the smartphones. When both apple and android allowed VoIP integration on their smart phones, Samsung also started work on it and after a small wait we got a number of android smart phones.

"Actually VoIP is a new technology that allows users to call with the use of mobile the internet like the wifi and the 4G network. In most cases, you can have free calls if you can discover cheap internet in your zip code"

Let us go to the main arsenals Samsung Galaxy phone users can use in order to maximize their phones in VoIP usage.

Internet connection
Like a car, your smartphone needs fuel. And its fuel is the internet connection. Make sure you have a good internet connection that can accommodate traffic from VoIP. If you don’t secure a good connection, your smartphone will have no significance from your ordinary GSM phones. Another thing to remember is that VoIP runs with a good and stable mobile internet connection.


Update
Others say that VoIP through smartphones are the worst mode of communication. Don’t believe this one. The secret to a superlative experience of VoIP in a smartphone is constant updating of the softwares and applications you use for the call. Now, let us face it. Most of the applications are free and all they ask of you is to update it in your phone. Would that be so difficult for you.

Choose a good VoIP application
Next to a stable internet connection is the proper use of applications. Choose a good VoIP application that is known to your community of friends and family. Another thing to consider is the price of the application. There are a lot of free VoIP applications that can be used in android. You can download it and choose amongst them which one t is compatible with the application of the person you are calling

Identify your phone functions
If you download some VoIP applications to your Samsung Galaxy phone, you must identify and locate the buttons of your video camera (front and back), ear and mouth piece. In most cases, you must also locate and practice how to use Bluetooth headset for convenience. Samsung Galaxy phones are the most user friendly phones ever built in this planet so take your time reading the manuals and instructions for operations.

Wednesday, September 12, 2012

How to filter DataTable columns C# .Net

Add, Delete, Modify and Filter columns in a DataTable

Some times we need to filter some columns when we have a dataTable  with much more unused Data Columns then we think that How to filter only required columns after removal of useless columns. Here I am giving you a solution this might be useful for you.

            string unUsedColumnNames = "col1,col2,col3";
            DataTable dt1 = (DataTable)Session["data"];     //  I have a DataTable stored in session
            DataTable dt2 = new DataTable();
            dt2 = dt1.Copy();
            foreach (DataColumn column in dt1.Columns)
            {
                if (unUsedColumnNames.Contains(column.ColumnName))
                {
                    dt2.Columns.Remove(column.ColumnName);
                }
            } 

Now we get dt2 as filtered DataTable from original DataTable dt1.

Sunday, September 2, 2012

Define C# data types, their storage size and classes

Let us know!
What are Data Types defined in C# .Net?
Describe storage bytes required for different c# Data Types

"Being a good Dot Net developer we must know about the proper use of Data types[where to use which data type]. Improper use of data types may cause extra memory allocation"

All the data types in .net are available within the namespace System.
Category Class/Structre NameData Type Storage Bytes Range
IntegerSystem.Byte Byte 1(Unsigned) 0 to 255
System.SByteSbyte1(Signed)-128 to 127
System.Int16 Short 2(Signed) -32,768 to 32,767
System.Uint16Ushort2(Unsigned)0 to 65,535
System.Int32 Int 4(Signed) -2,147,483,648 to 2,147,483,647
System.Uint32Uint4(Unsigned)0 to 4,294,967,295
System.Int64 Long 8(Signed) -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
System.Uint64Ulong8(Unsigned)0 to 18,446,744,073,709,551,615
Float
SingleFloat4±1.5e−45 to ±3.4e38
(Precision:7 digits)
DoubleDouble8±5.0e−324 to ±1.7e308
(Precision:15-16 digits)
DecimalDecimal16(-7.9 x 1028 to 7.9 x 1028) / (100 to 28)
(Precision:28-29 digits)
Character
CharChar2
StringStringsize varies
Other
DateTimeDateTime8
BooleanBool1
ObjectObjectsize variesCan store any type of value

How to create Excel from DataTable DataSet C # dot net

Create an customized Excel file from a DataSource

Sometimes we need to create an Excel file from a DataTable OR DataSet then we think how to do this. Dear you no need to get worry about this task it's so simple. Here I am writing the simple and easy code with detailed description.

Design part[aspx page]

<asp:Button ID="btnExport" runat="server" Text="Export Data" OnClick="btnExport_Click" />


Code behind part[aspx.cs]


 protected void btnExport_Click(object sender, EventArgs e)
        {
            try
            {
                // Here I have a DataTable in session
                DataTable dtExports = (DataTable)Session["dtShadow"];
                Response.Clear();
                Response.ClearContent();
                Response.ClearHeaders();
                Response.Buffer = true;
                Response.AddHeader("content-disposition", "attachment;filename=Member.xls");
                Response.Charset = "";
                Response.ContentType = "application/vnd.ms-excel";

                Table mainTable = new Table();

                TableRow trExport;
                TableCell cellExport;

                if (dtExports.Rows.Count > 0)
                {
                    trExport = new TableRow();
                    for (int col = 0; col < dtExports.Columns.Count; col++)
                    {
                        cellExport = new TableCell();
                        cellExport.Text = dtExports.Columns[col].ToString();
                        cellExport.BorderWidth = 1;
                        cellExport.Style.Add("font-weight", "bold");
                        cellExport.Style.Add("text-align", "Left");
                        cellExport.BackColor = System.Drawing.Color.Silver;
                        trExport.Cells.Add(cellExport);
                        mainTable.Rows.Add(trExport);
                    }

                    for (Int32 ai = 0; ai < dtExports.Rows.Count; ai++)
                    {
                        trExport = new TableRow();
                        for (Int16 cl = 0; cl < dtExports.Columns.Count; cl++)
                        {
                            cellExport = new TableCell();
                            cellExport.Text = Convert.ToString(dtExports.Rows[ai][cl]).Trim();
                            cellExport.BorderWidth = 1;
                            cellExport.Style.Add("text-align", "left");
                            cellExport.Style.Add("vertical-align", "top");
                            trExport.Cells.Add(cellExport);
                        }
                        mainTable.Rows.Add(trExport);
                    }
                }

                StringWriter sw = new StringWriter();
                HtmlTextWriter hw = new HtmlTextWriter(sw);
                mainTable.RenderControl(hw);
                Response.Flush();
                Response.Write(hw.InnerWriter.ToString());
                Response.Flush();
                Response.End();
            }
            catch(Exception ex)
            {
               
            }
        }

In next post I will tell you about the design and formatting of excel with the help of example, means you can download the data of Gridview into an  excel file as it it displaying in GridView.

For any query OR suggestion write back to us.

 
Powered by Code Imagine