Skip to main content

Posts

Showing posts from October, 2008

Asp.Net CAPTCHA and Asp.Net AJAX CAPTCHA

I am using a great Asp.Net CAPTCHA by BrainJar in a number of web sites with and without Asp.Net AJAX. It’s a simple and really easy to use Asp.Net CAPTCHA. The actual source code is in C#, but you can use it with both C# and VB.Net by simply wrapping the functionality in a class library. In Asp.Net forums and in many other user communities I have seen lot of people asking for VB.Net CAPTCHA. So I thought to write a blog post and create some sample implementations. The zip file contains C# CAPTCHA and VB.Net CAPTCHA. I have included the samples for Asp.Net AJAX CAPTCHA also. You can download the samples and implementation from here Implementing Asp.Net AJAX CAPTCHA is really simple. Just wrap the main Asp.Net CAPTCHA with Asp.Net AJAX update panel and put a random query string at the end of CAPTCHA image src. The random query string will avoid showing the old CAPTCHA from browser cache. STEPS TO ADD ASP.NET CAPTCHA IN YOUR WEBSITE Refer the assembly CaptchaDLL.dll in your project Copy...

Numeric Datalist/Repeater paging - User control version

I have wrapped the functionality of numeric datalist pagination ( read the full details here ) into a user control, so that you don’t need to copy and paste the code in all the pages. The usercontrol and sample implementation with some good pagination style can be downloaded from here. DOWNLOAD THE SOURCE AND SAMPLES FROM HERE Visit this blog if you want to know the details about implementing numeric paging with datalist or repeater. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - If you are looking for Sql Express DTS/Data transfer wizard click here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TAGS datalist pagination,paginating datalist,pagination datalist,asp.net datalist pagination,datalist and pagination,c# datalist pagination,pages datalist,paging datalist,datalist paging,repeater pagination,paginating repeater,pagination repeater,asp.net repeater pagination,repeater and pagina...

Simple Numeric Pagination for DataList and Repeater

There are a big number of tutorials available on how to implement pagination in asp.net DataList and Repeater. But all of them are explaining only about the Next/Prev mode of pagination only. Recently I have implemented a quick and dirty numeric pagination on DataList for one of my project. The idea is simply use a PagedDataSource to get the current page of data and bind it to DataList or Repeater. Now create dynamic Linkbuttons using the PageSize and the Total rows count. See the code below. ASPX Code <head runat="server"> <title>Untitled Page</title> <style type="text/css"> .pagination a{padding:5px;} .pagination span{padding:5px;} </style> </head> <body> <form id="form1" runat="server"> <div> <asp:DataList ID="dlPaginationSample" runat="server"> <ItemTemplate> <%# Eval("Column1")%> | <%# Eval(...

Move to anchor after ASP.Net AJAX postback

Here is the code to move to anchor after postback <script language="javascript" type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(OnEndRequest); function OnEndRequest(sender,args) { window.location.hash = '#MOVEHERE'; //MOVEHERE is the anchor name } </script> If you want to show top of the page instead of move to anchor use window.scrollTo(0,0); instead of window.location.hash = '#MOVEHERE';