Posts

Showing posts from July, 2013
Gridview export to excel without having control like linkbutton, or anybutton(to hide columns) Frontend note: <%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="CarMake.aspx.cs" Inherits="admin_CarMake" EnableEventValidation="false" %>     ----------------------------------------------------------------------------------------- Backend cs:- protected void btnExport_Click(object sender, EventArgs e) { ExporttoExcel(); } public override void VerifyRenderingInServerForm(Control control) { /* Verifies that the control is rendered */ } private void ExporttoExcel() { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=ExistingCarData" + System.DateTime.Now.ToShortDateString() + ".xls"); Response.Charset = ""; Response.ContentType = "application/vnd.xls"; Str
update multiple columns into single or one columns in sql begin tran CREATE TABLE #TempAdd ( DealerId int, MainAddress varchar(1000) ) insert into #TempAdd SELECT DealerId , DealerName + '<br/>' + CASE          WHEN Address1 is null  THEN  ''          ELSE Address1 +' <br/>'       END  + CASE          WHEN Address2 is null  THEN  ''          ELSE Address2 +' <br/>'       END  +  CASE          WHEN Address3 is null  THEN  ''          ELSE Address3 +' <br/>'       END   +       CASE          WHEN Address is null  THEN  ''          ELSE Address +' <br/>'       END       + CASE          WHEN PINCode is null  THEN  ''          ELSE PINCode +' <br/>'       END        + CASE          WHEN StateName is null  THEN  ''          ELSE StateName +' <br/>'       END as MainAddress  from dealer UPDATE dealer SET dealer.MainAddress=#TempAdd.MainAddress FR
session in asp.net save at server side or client side :- The SessionID is generated Server Side, but is stored on the Client within a Cookie. Then everytime the client makes a request to the server the SessionID is used to authenticate the existing session for the client.