Posts

How to replace <p> </p> in gridview rows in asp.net c# <asp:TemplateField HeaderText="Questions" SortExpression="TheQuestion"> <ItemTemplate> <asp:Label ID="lblQuestion" runat="server" Text='<%# Server.HtmlDecode(Eval("TheQuestion").ToString()) %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Left" Width="100%" /> </asp:TemplateField>
Extract Only Numeric in C# string Retcode = Regex.Replace(Request.QueryString["code"].ToString(), "[^0-9]+", string.Empty);
Insert – save multiple checked checkbox values in SQL Server http://www.webtechminer.com/split-function-in-sql-server-to-break-comma-separated-string/
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  ''  ...
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.
Image
Preview image file before upload to webserver   Ref: http://blog.raminassar.com/2011/07/05/preview-image-file-before-upload-to-webserver/#.UZcVs6JHLRJ     Muddsar Khan http://www.aspsnippets.com/Articles/Display-image-after-upload-without-page-refresh-or-postback-using-ASP.Net-AsyncFileUpload-Control.aspx     You can use javascript to preview the selected image before uploading it to the server. < html xmlns ="http://www.w3.org/1999/xhtml" > < head id ="Head1" runat ="server" > < title > Main Page </ title > < script type ="text/javascript" > function FileUpload1_onchange(oFileUpload1) { document.getElementById( 'Image1' ).src = oFileUpload1.value ; } </ script > </ head > < body > < form id ="form1" runat ="server" > < asp:FileUpload ...