Welcome to MSDN Blogs Sign in | Join | Help

Many Updates on Dynamic Data

This week at Redmond we have the ASP.NET Insiders up here where we show them a bunch of the new stuff we are working on. I'm happy to announce that we have many new update for Dynamic Data that are available today:

1) Dynamic Data Runtime and Dynamic Data Wizard - this has been updated with a much newer version of the Dynamic Data Wizard which have over 30 bug fixes. This is a wizard that provides many options for which tables to show, which modes to show them (read only/read write, etc) and allows multiple tables in the same page. All of the generated code uses features from the new Dynamic Data feature.

2) Dynamic Data Futures - this is a sample project that shows off many of the cool directions we are looking at for the next version of Dynamic Data. An example of some of these features are: ADO.NET Data Services (formerly known as Astoria), ObjectDataSource, binding and validation for plain old CLR objects (POCO), metadata for ordering columns,  adding metadata at runtime, support for images, advanced filtering including cascading and much more.

3) Dynamic Data for MVC Preview - we are working to support Dynamic Data on the new ASP.NET MVC framework as well. This is an EARLY release of this support. Compared to the WebForm version this has the current limitations: Only supports Linq to SQL, does not have client side validation and does not have filters on the list pages. Futures releases will address each of these items plus provide much more.

Posted by scothu | 3 Comments

Interview with Craig Shoemaker Posted

Last week I had a great chat with Craig Shoemaker on Dynamic Data. We talked about using Dynamic Data in existing applications, some about our new Futures release and some about upcoming work on having an MVC version of Dynamic Data. You can check out the interview on Pixel8 by clicking here: Craig Shoemaker interview

Posted by scothu | 1 Comments

How to add Dynamic Data to an Existing Web Application

Yesterday I posted about how to add Dynamic Data to an existing website and I got some feedback about how to add Dynamic Data to an existing web application. Web application projects work a little different the website projects, you can check out the differences here: http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx.

1) Create a dummy Dynamic Data web application project. Copy the DynamicData directory from it into your existing web application. You should also copy the Site.css and Site.master files. The Default.aspx file is optional, it display a menu of tables in your data model, this file is only needed if you plan on having such a menu in your application. IMPORTANT: Web application projects have namespaces in their code behind files, you may want to change the namespaces of the copied in files to match the namespace of your existing project. 

2) You can copy the Global.asax file or if you already have such a file you can just add the model registration and url routes as below to the

<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="System.Web.DynamicData" %>

void Application_Start(object sender, EventArgs e) {

MetaModel model = new MetaModel();

model.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false });

routes.Add(new DynamicDataRoute("{table}/{action}.aspx") {
    Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
    Model = model
});

}

3) Right click on the References node in the solution explorer and select "Add Reference". In the dialog that opens up you need to select System.ComponentModel.DataAnnotations, System.Web.Abstractions, System.Web.DynamicData and System.Web.Routing.

4) In the <compilation> section in web.config add the following assemblies:

<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

5) In the <pages>/<controls> section add the following new tag prefix:

<add tagPrefix="asp" namespace="System.Web.DynamicData" assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

6) Enable the new ASP.NET Routing feature:

IIS 5/6/Casini

In the <httpModules> section add the following new module:

<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

IIS 7

In the <system.webServer>/<modules> section add the following:

<remove name="UrlRoutingModule" />

<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

In the <system.webServer>/<handlers> section add the following:

<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

 

At this point Dynamic Data should be functional. To enable it see the steps at the bottom of yesterdays post.

Posted by scothu | 3 Comments

How to add Dynamic Data to an Existing Web Site

I've had various people ask me if Dynamic Data can be added to an existing website and I've compiled a list of steps to do this. We hope to add a tooling gesture to Visual Studio in the future to automatically do these steps. Once these steps are complete you can start taking advantage of Dynamic Data functionality in your existing applications.

1) Create a dummy Dynamic Data Website project. Copy the DynamicData directory from it into your existing website. You should also copy the Site.css and Site.master files. The Default.aspx file is optional, it display a menu of tables in your data model, this file is only needed if you plan on having such a menu in your application.

2) You can copy the Global.asax file or if you already have such a file you can just add the model registration and url routes as below to the

<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="System.Web.DynamicData" %>

void Application_Start(object sender, EventArgs e) {

MetaModel model = new MetaModel();

model.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false });

routes.Add(new DynamicDataRoute("{table}/{action}.aspx") {
    Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
    Model = model
});

}

 

3) In the <compilation> section in web.config add the following assemblies:

<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

 

4) In the <pages>/<controls> section add the following new tag prefix:

<add tagPrefix="asp" namespace="System.Web.DynamicData" assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

 

5) Enable the new ASP.NET Routing feature:

IIS 5/6/Casini

In the <httpModules> section add the following new module:

<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

IIS 7

In the <system.webServer>/<modules> section add the following:

<remove name="UrlRoutingModule" />

<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

In the <system.webServer>/<handlers> section add the following:

<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

 

At this point you need to register your Linq to SQL data modelin step #2 and optionally enable scaffolding by setting ScaffoldAllTables := true in the registratoin line. At this point if you copied the Default.aspx from the dummy Dynamic Data application you can execute it to view the scaffold. You can also enable Dynamic Data in existing web pages that use GridView, ListView, FormView and DetailsView by adding a DynamicDataManager to those pages and then registering the data control with the dynamic data manger:

 

<asp:DynamicDataManager id="DynamicDataManager1" runat="server">

<asp:GridView id="GridView1" runat="server">

...

DynamicDataManager1.Register(GridView1);

 

Inside of your GridView or DetailsView you can either use AutoGenerateColumns or you can use DynamicField controls in your column collections. If you are using ListView or FormView use DynamicControl to display values for each of your columns.

Posted by scothu | 4 Comments

Dynamic Data DbImage SampleUpdated

I posted a sample back in January on how to display images from databases or the file system using Dynamic Data. You can view that post HERE. I've just updated that sample to fix some bugs and add some new functionality. You can download the latest version of DbImage from this link: DOWNLOAD DBIMAGE.

Here is a list of the changes and updates I've made since the original post:

1) Fixed an issue that caused DbImage not to work when the primary column for the table is a GUID.

2) Added support for compound primary keys (primary key that is more then one column in the table).

3) Added support for Entity Framework (previous release would display images in Entity Framework but fail to update them).

4) The asp:FileUpload control does not work correctly inside of UpdatePanels with partial rendering turned on. By default the templates in Dynamic Data are enclosed in UpdatePanels with partial rendering turned on. This means that uploading of images will fail unless partial rendering is disabled. The new sample adds a helper method call in the Page_Init of the Insert, Edit and ListDetails page templates. This helper call looks to see if any of the displayed columns are DbImage columns and if so turns off partial rendering for the page.

DbImageAPI.ImageHelper.DisablePartialRenderingForUpload(this, DetailsDataSource.GetTable());

Posted by scothu | 8 Comments

Dynamic Data is on .NET Rocks!

A few weeks ago I did an interview with Carl and Richard from .NET rocks on Dynamic Data. You can listen to it here: http://www.dotnetrocks.com/default.aspx?showNum=349.

Posted by scothu | 5 Comments

New Refresh of Dynamic Data Runtime and Tools is Posted

Tonight we posted a new release of the Dynamic Data Runtime and Tool on the Code Gallery website. You can grab the new release by clicking here: http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=954. We have also updated the samples to work with the latest runtime, they are available here: http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=850.

There are many changes and fixes in this new update. Here are the highlights:

Installation

The previous release could experience problems during installation on 64-bit computers and on computers that do not have the full .NET Framework SDK installed. The current release includes the required tools for installation, so it works on computers that have just the .NET Framework 3.5 installed. Installation on 64-bit computers should work properly now.

Upgrading

Various changes have been made to the field templates and .css files that are in the “DynamicData” folder. The best upgrade path (if practical) is to copy the new “DynamicData” folder into an existing project; the new folder contains all the latest field templates.

Documentation

The previous release was released with no documentation except the Readme file. This release contains a "Preliminary ASP.NET Documentation.chm" Windows Help file file that contains some documentation for ASP.NET Dynamic Data. This is ASP.NET 3.5 pre-release documentation and is not supported by Microsoft. Blank topics are included as placeholders and existing content is subject to change in future releases.

Dynamic Data Runtime

Dynamic Data now defaults to using separate pages for listing and editing data instead of using the combined List/Details style that was used in the earlier release. You can re-enable the previous method by changing the routes in the Global.asax file.

All metadata attributes now perform validation in the Web page. In the previous release, a metadata validation attribute caused validation to be performed only if the field template contained an ASP.NET server validation control that mapped to the attribute.

Dynamic Data now can use routing not only for the path, but for the query string as well. For example, instead of having the primary key passed as an explicit query string value (Products/Details.aspx?productid=1) , the key can instead be part of the URL (Products/Details/1). This change enables you to create cleaner routes, as shown in the following example:

RouteTable.Routes.Add(new DynamicDataRoute("MyCategoryDetail/{CategoryID}") {

Model = model,

Table = "Categories",

Action = "Details"

});

RouteTable.Routes.Add(new DynamicDataRoute("{CategoryID}/MyProductList") {

Model = model,

Table = "Products",

Action = "List"

});

In the first route definition, the primary key is passed as part of the path (for example, /app/MyCategoryDetail/5). In the second example, the foreign key is being passed as part of the URL (for example, /app/5/MyProductList). The foreign key does not have to be reversed, obviously; this example just shows what you can do with routing in Dynamic Data.

The DataTypeAttribute attribute has new values, such as EmailAddress and Html. When DataTypeAttribute is applied to columns with types of Date, Time, and Currency, Dynamic Data now applies default formatting of {0:d}, {0:t}, and {0:C} automatically, which provides a nicer display in display and edit modes. You can override this behavior by placing a DisplayFormatAttribute attribute on the column.

The fallback behavior of Dynamic Data for types that are not recognized has been changed. Instead of displaying an exception, a blank value is returned. This occurs when columns are displayed that Dynamic Data does not have a field template for.

The TextArea_Edit.ascx field template has been renamed to MultilineText_Edit.ascx. This change was made so that he template maps to the MultilineText data type that DataTypeAttribute supports. In addition, the <textarea> element that is rendered by the control has been made larger.

Tools and Dynamic Data Website Wizard

The Dynamic Data Website Wizard (Preview) template is now supported for Visual Basic.

The pages generated by the wizard have undergone the following changes:

· Pages use the included Site.master page by default. (Eventually the wizard will let you choose a custom master page or choose to use no master page.)

· ValidationSummary and DynamicValidator controls are generated, which enables automatic handling of validation exceptions.

· Improvements and changes have been made to the styles that are applied to the wizard-generated pages. These changes are defined in Site.css.

· An improved ListViewPager user control for paging in the ListView control has been added to the template.

· Several code generation improvements have been made. These includes rendering drop-down lists for foreign-key fields in edit and insert modes, confirmation dialog boxes for Delete links, addition of an EmptyDataTemplate template in the ListView control, and fixing the Show All Items (formerly Go Back) links for Details forms.

Posted by scothu | 5 Comments

Podcast with Scott Hanselman on Dynamic Data

I was able to sit down with Scott Hanselman last week after giving a Dynamic Data talk to the Microsoft MVP's and record a podcast about Dynamic Data. Here is a link to the podcast, enjoy: http://www.hanselminutes.com/default.aspx?showID=127

Posted by scothu | 1 Comments

Telerik has released some sample field template controls for Dynamic Data

One of the very cool extensibility points of Dynamic Data is our field template mechanism. In the existing data controls like GridView and DetailsView when the controls render a column they use some build in classes like BoundField, CheckBoxField, etc to display the column. These are not very extensible and once you decide you want to take over the rendering you need to turn the column into a templated column and manually manage the column yourself. With Dynamic Data what we have done is created a new concept called a Field Template which has a naming convention based on the data type. We provide the source code to these and they live in a directory "DynamicData\FieldTemplates". What this means is if you want to change the way a boolean column is rendered or edited you can go into that directory and modify Boolean.ascx and Boolean_Edit.ascx yourself. Whatever changes you make here will affect the way that booleans are shown and editing across your entire site. You can also add new FieldTemplates with custom names and in that case to make the control use them you can either mark you data model with a UIHint:

[MetadataType(typeof(ProductMetadata))]

public partial Product {

}

 

public class ProductMetadata {

  [UIHint("IntegerSlider")]

  public object UnitsOnOrder { get; set; }

}

 

or do it on page by page basis:

 

<Columns>

<DynamicField DataField="UnitsOnOrder" UIHint="IntegerSlider">

</Columns>

 

This should be really exciting for custom control vendors because they can now create FieldTemplate controls which can be dropped in the directory making our controls automatically use their fancier controls right out of the box. Telerik has released some early samples of some of their controls wrapped in FieldTemplates today which you can look at by jumping to this blog post: http://blogs.telerik.com/AtanasKorchev/Posts/08-04-16/RadControls_and_ASP_NET_Dynamic_Data_-_Part_Deux.aspx?ReturnURL=%2fblogs.aspx. We have other control vendors doing the same thing and I will blog about them when they are released.

Posted by scothu | 0 Comments

New Public Preview of Dynamic Data is Now Available

Today we released a new public release of Dynamic Data on the MSDN code gallery site. You can download the new version at: http://code.msdn.microsoft.com/dynamicdata. These releases are cutting edge releases and not as refined as a CTP but this is a great way for us to get much newer code than the December CTP into peoples hands. We need as much feedback as we can get on this new version so we can lock down Dynamic Data for RTM.

 

Also as part of this new public release is the new "Dynamic Data Website Wizard". This is a new wizard for building a Dynamic Data drive site from a wizard type experience. You can select a database, decide which items from the database need to be in the data model then customize the site on a page by page basis determine which operations the pages support including layout types. Then the tool generates the actual website using the features of Dynamic Data controls. You can read much more and see a screencast at: http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Wizard&referringTitle=Home

 

We have also released some samples including an image library for Dynamic Data. You can see these samples at: http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Samples%20Page&referringTitle=Home.

 

Please try out these new bits and give us feedback on the ASP.NET forums at: http://forums.asp.net/1145.aspx

Posted by scothu | 2 Comments

Sample for Displaying Images Updated + Screencast

We've recently started getting newer builds of Dynamic Data out to the private testers and soon to more public testers. As a result I've got an updated version of my image controls that I posted on my blog in January. As well I've recorded a screen cast that shows how to use the image controls in a project. Here is the link to the new DbImage project for display images from the database or file system in a Dynamic Data project: DOWNLOAD DBIMAGE.

 

Here is a link to a screencast on how to use the controls: VIEW SCREENCAST.

 

Basic steps for using this in a project:

 

1) Open the zip file and open the redist directory. Copy the DLL from the Bin directory to the Bin directory in your website.

2) In the Redist\FieldTemplates directory copy the files from that directory to the DynamicData\FieldTemplates directory in your website.

3) Open the web.config and add "<add path="ImageHandler.ashx" verb="*" type="DbImageAPI.ImageHandler" />" to the httpHandlers section of your web.config.

 

At this point you have enabled image support in your project. To get it to work you need to add a UIHint attribute to the column in your data model that contains the image. Here are the steps for doing this for the Category table in Northwind.

 

1) Create a partial class for the Category table to extend the Category table in the data model. Right click on the project and click "Add New Item". Select "Class". Type in "Category". Press Add.

2) Add "using System.ComponentModel.DataAnnotations" and "using DbImageAPI" to the using clause section.

3) Change the definition of the class to look like this:

[MetadataType(typeof(CategoryMetadata))]
public partial class Category
{
}

public class CategoryMetadata {
    [UIHint("DbImage")]
    public object Picture { get; set; }
}

What we have done is changed the Category class to be a partial class so it extends the class from the data model. Next we have created a class "CategoryMetadata" that is used to provide metadata for the Category class. The MetadataType attribute is what associates this class with the original Category class. Next we have created a Picture member which we can place metadata on (this is sort of a hack we do today because C# does not support adding attributes on existing members in partial classes, hopefully a future version of C# will address this). Then we apply the UIHint attribute which specifies which field template will be used to render this column.

 

At this point running the application should display the images.

 

The sample download contains both the redist directory that contains all the stuff for adding this support to an existing project. Plus a fully running sample that builds the library. Enjoy!

Posted by scothu | 8 Comments

Presenting At VSLive in San Francisco Next Week

I will be presenting Dynamic Data at VS Live in San Francisco next week on March 31, 2008. You can see full details of the show here: http://vslive.com/2008/sf/. My presentation is at 3pm on Monday. If you are at the show please stop by and see Dynamic Data in action. Bradley Millington from the Web Tools team will be doing a presentation on Visual Studio 2008 and .NET 3.5 as well. Plus there are sessions on MVC and Silverlight. Hope to see you there!

Posted by scothu | 0 Comments

Cleaning up Default GridView Markup

I saw an interesting question today from a customer related to some of the default markup for a GridView. The following code:

<asp:GridView ID="GridView1" runat="server">
</
asp:GridView>

Will generate this markup in the web page:

<table cellspacing="0" rules="all" border="1" id="GridView1" style="border-collapse:collapse;">

</table>

Adding:

CellSpacing="-1" GridLines="None"

Will clean the markup considerably generating this in the web page:

<table border="0" id="GridView1">

There currently is no way to get rid of the final Border="0" but the above technique does clean up the table considerably.

Posted by scothu | 0 Comments

Accessing Controls in ListView Templates

Today when doing some application building I came across a case where I wanted to embed a ASP control inside one of the template of the asp:ListView control. This is legal and simple todo, however it has some interesting effects. Since the control is embedded in a template it is not made available in the code behind file and in my case I wanted to be able to access the control in the code behind file. Here is an example of what my markup looked like:

<asp:ListView ID="ListView1" runat="server">
    <
LayoutTemplate>
        <
table>
            <
tr>
                <
td><asp:PlaceHolder ID="ItemPlaceHolder" runat="server"></asp:PlaceHolder></td>
            </
tr>
            <
tr>
                <
td>
                    <
asp:Button ID="ButtonTest" runat="server" Text="Button" />
                </
td>
            </
tr>
        </
table>
    </
LayoutTemplate>
</
asp:ListView>

I searched the Internet for a solution to this problem and many of the common solutions to the problem I found where to hooked to ItemCreated or DataBound event from the ListView, then using FindControl to find the control and store it in a variable that was part of the page class. While this is entirely doable it leads to really clunky code and there is a much better method for doing this. Controls have the same life cycle methods that the page itself has an by handling the Init event for the button I can get access to the button as soon as it is created and store a copy off that can be used when other parts of the page fire events.

Here is the change to the markup above:

<asp:Button ID="ButtonTest" runat="server" Text="Button" oninit="ButtonTest_Init" />

And here is what the code behind looks like:

public partial class _Default : System.Web.UI.Page {
    Button ButtonTest;

    protected void ButtonTest_Init(object sender, EventArgs e) {
        ButtonTest = (Button)sender;
        ButtonTest.Text = "Foo";
    }

    protected void ListView1_ItemDeleted(object sender, ListViewDeletedEventArgs e) {
        ButtonTest.Text = "Add";
    }

}

The ButtonTest_Init event handler stores the button in ButtonTest and changes it's text. You will also note that because I've done this I can now access the button inside other event handlers the ListView may fire, which was my initial goal. All in a very clean manner not hooking ListView events and not calling FindControl.

Posted by scothu | 1 Comments

Sample for Displaying Images from the Database using Dynamic Data

I'm posting a sample project that shows some custom field template controls for Dynamic Data that allow images to be viewed/edited from a database. The sample also shows how you can view images that have their filenames in the database but the images on the physical disk. You can download the sample by clicking this download link: DOWNLOAD SAMPLE

Here are the basics sets that are required if you want to add this functionality into you own Dynamic Data project:

 

1) Reference the DbImageAPI library in the sample to your Dynamic Data website.

2) Copy DbImage.ascx., DbImage.ascx.cs, DbImage_Edit.ascx, DbImage_Edit.ascx.cs, FileImage.ascx, FileImage.ascx.cs from the samples App_Shared/DynamicDataFields directory to the App_Shared/DynamicDataFields directory on your website.

3) Copy the Blank.gif from the samples App_Shared/Images to the App_Shared/Images directory in your website.

4) In the Web.Config file add "

<add verb="*" path="ImageHandler.ashx" type="DbImageAPI.ImageHandler"/>
" to the <httpHandlers> section.

 

Once these are done you just need to apply renderhints to the data model. For example if the table in the database is Categories you would create a partial class called Category and add the following metadata to the partial class:

[ImageFormat("Picture", 100, 100)]
[RenderHint("Picture", "DbImage")]
public partial class Category {

}

 

The RenderHint tells it to use the DbImage field template control to render the Picture column. There is also an additional attribute added which allows the width and height the image to be set as well. The ImageFormat attribute causes the control the dynamically scale the image keeping the proper aspect ratio.

 

If you have a database column that has filenames of images that exist in a directory in the website you can use the FileImage control. Here is an example:

[RenderHint("Filename", "FileImage")]
[ImageUrl("Filename", "~/images/{0}")]
[ImageFormat("Filename", 100, 100)]
public partial class FilePicture {
}

 

In this case the table in the database is FilePictures and a partial class of FilePIcture has been created to apply the attributes. The RenderHint tells it to render the Filename column using the FileImage field template control. The ImageUrl attribute is used to specify where on the website the images are located, in this cas the images are in the images directory underneath the root. And once again the ImageFormat attribute is used to specify a width/height. In the case of file based images this attribute just changes the width and height tags on the image.

 

I will go into much more detail about how these controls were created in a future blog post.

Posted by scothu | 7 Comments
More Posts Next page »
 
Page view tracker