Posts

Showing posts from 2011

view state difference session state

Session state  is the feature of ASP.NET based web applications using which values of a variable may be persisted and then posted to another page. Viewstate  property of a page or a control, or a viewstate object for a variable value, may also be created to persist its value across a postback. However, the viewstate value are for page level  , i.e. they cannot be posted across to another page. Session State is useful for storing values that must be persisted across multiple pages by the same user. ViewState is useful for storing serializable data that must be persisisted across PostBacks by a single page. If you use Session State, the value you insert will remain in memory until (1) The Session times out, or (2) Your code removes it. If you use ViewState, the value you insert will remain in ViewState until the user requests a different page. ViewState stores data betwen PostBacks by putting it into a hidden form field on the client HTML doc. when the doc is Posted Back, the values are

viewstate : statemanagement

Client side State management Options: ASP.NET provides various client side state management options like Cookies, QueryStrings (URL), Hidden fields, View State and Control state (ASP.NET 2.0). Let's discuss each of client side state management options. Bandwidth should be considered while implementing client side state management options because they involve in each roundtrip to server. Example: Cookies are exchanged between client and server for each page request. View State: View State can be used to store state information for a single user. View State is a built in feature in web controls to persist data between page post backs. You can set View State on/off for each control using EnableViewState  property. By default,  EnableViewState  property will be set to true. View state mechanism poses performance overhead. View state information of all the controls on the page will be submitted to server on each post back. To reduce performance penalty, disable View State for

difference between stored procedure and function

Below are few differences between Stored Procedure and Function 1) Stored procedure are compiled for first time and compiled format is saved and executes compiled code when ever it is called. But function is compiled and executed every time it is called. 2) Function must return a value but in stored procedure it is optional. 3) Function takes one input parameter it is mandatory but stored procedure may take o to n input parameters. 4) Functions can be called from select statement, but stored procedures can not be called from select statement. 5) We can build logic in functions and we can even break complex logic in to methods. 6) We can use try catch statements in stored procedures but in functions we can not use. 7) We can not use insert,delete,update and create statements in functions but in stored procedures we can use those statements. 8 ) Functions can have only input parameters but stored procedure can have input and out put parameters Thanks and Regar

Difference between Respone.Redirect and server.transfer

Introduction This article tell you the difference between  Server.Transfer  and  Response.Redirect. Server.Transfer v/s Response.Redirect Both “Server” and “Response” are objects of ASP.NET. Server.Transfer and Response.Redirect both are used to transfer a user from one page to another page. Both are used for the same purpose but still there are some differences are there between both that are as follows: Syntactically both are different, if you want to transfer the user to a page named newpage.aspx then syntax for both methods will be, Response.Redirect(“newpage.aspx”)  and  Server.Transfer(“newpage.aspx”) Response.Redirect involves a roundtrip to the server whereas Server.Transfer conserves server resources by avoiding the roundtrip. It just changes the focus of the webserver to a different page and transfers the page processing to a different page. Roundtrip means in case of Response.Redirect it first sends the request for the new page to the browser then browser sends the re

How to add a new row in GridView

<asp:gridview ID="Gridview1"  runat="server"  ShowFooter="true"         AutoGenerateColumns="false">         <Columns>         <asp:BoundField DataField="RowNumber" HeaderText="Row Number" />         <asp:TemplateField HeaderText="Header 1">             <ItemTemplate>                 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>             </ItemTemplate>         </asp:TemplateField>         <asp:TemplateField HeaderText="Header 2">             <ItemTemplate>                 <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>             </ItemTemplate>         </asp:TemplateField>         <asp:TemplateField  HeaderText="Header 3">             <ItemTemplate>                 <asp:DropDownList ID="DropDownList1" r

How to Use Bing API c#

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)     {         BingService service = new BingService();         //foreach (ImageResult  result in response.Image.Results)         //{         if (!RadioButton1.Checked)         {             if (RadioButtonList1.SelectedItem != null)             {                 if (RadioButtonList1.SelectedItem.Value == "Videos")                 {                     SearchRequest request2 = new SearchRequest();                     request2.AppId = "83DFCBA3482E132EF9837E3B505DFD015773E909";                     request2.Query = TextBox1.Text;                     request2.Sources = new SourceType[]                 {                     SourceType.Video                 };                     SearchResponse response2 = service.Search(request2);                 }                 else                 {                     SearchRequest request = new SearchRequest();                     requ

Two Entrey Points (Main() methods in single file)

hey Guys !                      Today we will discuss name of the topic of "Two entry point in a single file of c#". first of all you have to make a file in your console application. Then just made Two class along with his own Main() method. so here we go........ your file name is krishan.cs.. suppose you have a student class class student {             Public  static void Main() {               Console.WriteLine("This is first method"); } } and now we are making a another class name is Teacher class Teacher { // In this Teacher class we are making a another Main() method... // c# concept don't take a permission of this doing like ....Two entry point    Public static void Main() {         Console.WriteLine("This is Second Method"); } } Now if your compile this code then you got the error message that you have a Two entry point in your class. Now for solve this problem...go to command prompt of your Visual Studio. now goto

Two Entrey Points (Main() methods in single file)

hey Guys !                      Today we will discuss name of the topic of "Two entry point in a single file of c#". first of all you have to make a file in your console application 

Two Entrey Points (Main() methods in single file)

hey Guys !                      Today we will discuss ncam

Two Entrey Points (Main() methods in single file)

hey Guys !                      Today we will discuss ncam

Aaj Bhut Yaad Aya................

Aaj rootha huwa ik dost bohot yaad aaya, Acha guzra huwa kuch waqt bohot yaad aaya..! Meri aankho ke har ik ashk pe ronay wala, Aaj jab aankh yeh roee to bohot yaad aaya… Jo mere dard ko seene main chupa laita tha, Aaj jab dard huwa mujh ko bohot yaad aaya… Jo meri aankh main kajal ki tarah rehta tha, Aaj kajal jo lagaya to bohot yaad aaya… Jo mere dil ke tha qareeb faqat us ko hi, Aaj jab dil nay bulaya to bohot yaad aaya… Mere jeevan ki her khushi main wohi tha bus, Aaj jab yaad woh aaya to bohot yaad aaya..!!!