Blog ( Of Ryan Olshan)

Recent Posts

News

About Ryan Olshan

LinkedIn Profile

Follow Ryan via twitter

Join StrongTypes - Free Generics Help By Email
Join StrongTypes

Community Credit Winner

View my MVP profile

The posts on this weblog are provided "as is" with no warranties and confer no rights. The opinions expressed herin are my own personal opinions and do not represent my employer's view in any way.

Subscribe to Rolog via My AOL
Subscribe to Rolog via Bloglines


Subscribe to Rolog via Feedburner

Furl Rolog




Subscribe to Rolog via Newsburst


Subscribe to Rolog via Pluck

Add Rolog to Technorati Favorites




Thycotic Secret Server

Receive Email Updates


.NET Websites

  • => StrongTypes.com <=
  • Community Credit
  • DotNetCharity.com
  • DotNetSlackers
  • EasyListBox
  • LearnAsp.com
  • SystemNetMail.com
  • SystemWebMail.com

Blogroll

  • Alex Campbell
  • Carlos Magalhaes
  • Charles Carroll
  • Chris Taylor
  • Darren Neimke
  • David Betz
  • Eric Smith
  • Rob Caron
  • Rob Howard
  • Sam Gentile
  • Scott Guthrie
  • Scott Mitchell
  • Tess
  • Wesner Moise
  • Jason Alexander
  • Bill Ryan
  • Steve Smith
  • Sahil Malik
  • David Silverlight

Other Websites

  • 911 Pigeon Alert
  • Pacific Wildlife Project

Strong Coder Bloggers

  • Dean Fiala
  • Doug Nelson
  • Kevin Jones

Yahoo! Groups

  • => StrongTypes <=
  • AspNet2
  • AspNet20GridView
  • PayPalDevDotNet
  • RubyOnRails
  • VSTS

Thursday, January 26, 2006 - Posts

Generic List Collection / ObjectDataSource / GridView Sample

I put together sample code that will run on the Northwind database that demonstrates using a generic List collection as a data source for an ObjectDataSource which populates a GridView control. All you have to do is specify the connection string in Web.config and the sample code will run. Enjoy.

Download C# ObjectDataSource Sample
Download VB.NET ObjectDataSource Sample

Share this post: | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted: Jan 26 2006, 09:13 PM by Ryan Olshan | with no comments |
Filed under: , ,
Why doesn't a link in a HyperLinkField render?

It appears that there is a security feature built-in to the HyperLinkField that causes links that resemble JavaScript functions (i.e. java script:SomeFunction()), file paths (i.e. F:\Directory\File), and other non-URL strings not to render when using the DataNavigateUrlFormatString property. The only way I've discovered around this is to use a TemplateField with a HyperLink control.

Will not render a URL:

< asp : HyperLinkField DataTextField ="SomeField" DataNavigateUrlFields ="SomeField"
DataNavigateUrlFormatString ="java script:openWindow('/SomePage.aspx?SomeID={0}','SomeDescription','scrollbars=yes,width=442,height=500');" />

Will render a URL:

< asp : TemplateField >
   
< ItemTemplate
>
      
< asp : HyperLink Text =' <%# ((System.Data.DataRowView)Container.DataItem)["SomeField"] %> ' NavigateUrl =' <%# String.Format ("java script:openWindow('/SomePage.aspx?SomeID={0}','SomeDescription','scrollbars=yes,width=442,height=500');", ((System.Data.DataRowView)Container.DataItem)["SomeField"] as string) %> ' runat ="server"
/>
   
ItemTemplate
>
asp : TemplateField >

Share this post: | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted: Jan 26 2006, 09:08 AM by Ryan Olshan | with no comments
Filed under: ,
More Posts