LoginViews in GridView Template Fields and Data That Won't Bind

by Marvin 3. September 2008 12:26

So, I had a GridView with a TemplateField.  The TemplateField contained links that were used for deleting rows.  I had set up Membership and Roles, and I only wanted users in the "admin" role to see these delete links, so I wrapped them in LoginView.  However, when I did this, the links quit working.  Today, I spent several hours searching for a solution to this problem, and I found lots of forum posts where other developers were having the same trouble, but none of the suggestions that were posted worked for me.  They did give me some clues in the right direction, though.  I just needed to simmer in it a little while, and sure enough, while watching The Story Of Us with my wife, the answer came to me.  This article explains the problem in detail and how I solved it.  More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Web Development

About the author

I am a junior-level C# .NET developer living in Nashville, TN.  I'm currently working in biomedical informatics, developing a web service, a MySql database, and a web application.  Every week or so, I spend hours trying to figure out how to do something, and after I find the solution, I really want to make sure I don't go through that exercise again.  I love to write.  It helps me to remember things.  So, I use this blog as a way to document those painful lessons as I learn them.  It has already helped me to be able to refer back to them.  I hope some of these will save someone else some time as well.