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>
Posts
- Get link
- X
- Other Apps
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...
- Get link
- X
- Other Apps
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 '' ...
- Get link
- X
- Other Apps
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 ...