Thursday, March 28, 2013

Progress Bar in Update Panel in C#

Use below Code to have Progress Bar in ASP.net with C# using AJAX

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<asp:UpdateProgress runat="server" ID="UpdateProgress1"
DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img id="Img1" runat="Server" src="<Path of Gif or motion image file>" height="12"  alt=""/>
</ProgressTemplate>
</asp:UpdateProgress>
</td>
</tr>

</table>
</ContentTemplate>
</asp:UpdatePanel

Friday, March 22, 2013

Add RowNumber Column in Table


Hello I have a Table with column PageId and PageName.Now i want add one more column Rownumber while selecting data.

So we can use the following querry.

 WITH tempTable as
  (
    select ROW_NUMBER() Over(order by PageId) As RowNumber,* from tblPageInfo
  )
  select * from tempTable


This will list three column RowNumber,PageId,PageName

Replace in Data binding Eval() in C#

Eval("ThumbnailCaption").ToString().Replace("X", String.Empty))