Dot Net Tricks

Articles about .NET, ASP.NET, C#, Object Oriented Programming and Agile Methodologies
Welcome to Dot Net Tricks Sign in | Join | Help
in Search

Thoughts.Generate();

Using Page Properties as an ASP:ControlParameter

Let's just say that I'm not the biggest fan of the ObjectDataSource.   At netTiers, we had to write a custom control, the EntityDataSource to make up for all of the ObjectDataSource shortcomings.

I was baffled when I discovered this, but one of the most annoying things about the ObjectDataSource was when using a ControlParameter to specify a parameter from an existing control there was no clear way of using an existing page level property.  So I very hackishly used a server side hidden control so that the ObjectDataSource could read that value from the form.

Well, a team member on .netTiers, Bobby Diaz,  discovered this nifty little nugget of gold.

<asp:ControlParameter Name="MyMethodParameter" ControlID="__Page" PropertyName="MyPageProperty" ConvertEmptyStringToNull="false" />

I've always seen that in the trace output, but I never put 2 + 2 together.

Published Saturday, May 13, 2006 9:25 AM by rhinojosa
Filed Under:

Comments

No Comments
Anonymous comments are disabled

About rhinojosa

My thoughts on software principles, code generation, business practices, and the technology climate of today. Developer on the open source .netTiers code generation suite of templates! www.nettiers.com Get your copy today, or view a 15 minute video tutorial! http://www.codeproject.com/showcase/CodeSmith.asp

This Blog

Post Calendar

<May 2006>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Syndication

Powered by Community Server, by Telligent Systems