.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Here we go again: Extending the AdRotator control..

Posted By:      Posted Date: October 09, 2010    Points: 0   Category :ASP.Net

Hello all,

The AdRotator control seems to be one of the least discussed and documented controls in the .NET server controls library, so I'm gonna need a bit of help extending it to suit my needs.

My AdRotator-control is databound to an SQL-server datatable and so far this works nicely, but I need to be able to count the number of impressions a given advertisment has had and update my database. 

I am able to count clicks (using a redirect page), but since I'm using a database it seems that I have absolutely no access to either getting or setting the impressions for the banners.

So, could someone please elaborate on how to extend the control to get the functionality I'm looking for?

Thanks in advance, :)


View Complete Post

More Related Resource Links

Cutting Edge: Extending the GridView Control


Welcome to my100th consecutive installment of Cutting Edge. I've been writing this column since January 1998 in Microsoft Internet Developer. Looking back over the past eight years, I realize that I've touched on almost every subject in the Windows® SDK and the Microsoft® .

Dino Esposito

MSDN Magazine May 2006

Need serious help with the adrotator control!

I'm getting fed up with this thing.  I get it to work the way I want to, then it stops working.  I get it working again, it works for awhile, then it fails again.  Repeat several times.  And yup, I thought I finallt had this thing licked, and it's failing yet again.  I'm about to ditch it and write my own.  It wouldn't be very efficient, but at least it would work!I have had a working Google ad on the master page for some time.  Now I have a paying customer, and I'm hoping for more.  My thinking is to spread out the paying ad, displaying the Google ad in between.  I have cached pages, and I don't want the ad to be cached.  Iframes and server side iframes didn't work, I'm using Ajax now.  The problem is in the AdCreated event.  This may be where my problem has been all along, but with Ajax, I can see the error when it fails if I view the page on the server.  I have the adrotator on the master page like this:                        <div id="advertising1" style="position:relative; text-align:center; top:15px;">                       &

Extending a ListBox Control - How to make the extended type require the listbox items implement a ch


I am working on a drag and droppable timeline control, and I am making decent progress.  What I have so far will work decently enough with MVVM design patterns, but I am inexperienced with this kind of advanced control extending so I am sure that some of my methods are crude at best.

I have an extended content presenter control that I want to ensure is what is actually used inside my specialized listbox.  Right now I do the following:

<DataTemplate x:Key="TempTemplate" DataType="{x:Type local:TempDataType}">

			<tt:TimeLineItemControl StartTime="{Binding Path=StartTime}

Extending the expander control - MVVM pattern


Hi all,


I am using MVVM and need to create an expander that also has a "close" button, making it disappear.

I thought about creating a UserControl containing an Expander + Button with "close" caption.

Then, expose a Command property for that button click, handling it in the ViewModel.

Problem is, I have to expose many other Expander related properties as well (content, IsExpanded, IsEnabled etc...)

Is there any other idea for this issue?


Thanks a lot!

Extending GridView Control (II)


Hello, I'm trying to extend de GridView control with a Custom Server Control, I'm doing ok with extended properties but when I get to methods that need to re-apply or modifiy the DataSource I don't get any data in the grid, though the SQLDataSource actually retrieve data. Here is my MyGridView.applyFilter() method, which should filter the data but actually shows an empty GridView, but as I sayed, the DataSource has data. I try to find (FindControl) the SQLDataSource of the GridView (Me) and modifiy its paramters, then DataBind Me to apply the changes...

  Public Sub applyFilter(ByRef container As Control, ByVal param_names() As String)
    Dim final As Boolean = False
    Dim NFiltro As Integer = 1

    Dim ctlFilter As New Control

    If Not container Is Nothing Then
      Dim TheSQLDataSource As New SqlDataSource

      TheSQLDataSource = container.FindControl(Me.DataSourceID)

      If Not TheSQLDataSource Is Nothing Then

        With TheSQLDataSource
          .SelectCommand = "My_StoredProcedure"
          .SelectCommandType = SqlDataSourceCommandType.StoredProcedure

          Do While Not (final)
            ctlFilter = container.FindControl("bfiltro" & NFiltro)

            '....APPLY FILTER VALUES TO ST

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Business Modelling and Web Applications and extending UML

UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.

Using TemplateFields in the GridView Control

The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Easily manipulate data with the GridView control in ASP.NET 2.0

Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend