Someone on the ASP.Net forums helpfully gave me the solution. My code needs to go not in Page.Init, but in myGridView.Init. That makes all the difference in the world.
Thanks for the help, everyone.
Is there something specific in those two articles you thought I should look at? They both seem to be about creating templates programatically, which isn't what I'm trying to do.
I guess I could try dynamically generating all of my fields, including the two template fields--that may have been...
I thought it had a good chance, but it didn't work. I tried all of the events in the page lifecycle, and aside from PreInit throwing an error, the rest acted the same as PageLoad.
I'm dynamically adding columns to a GridView which contains two declaratively-defined TemplateFields which each contain a LinkButton. When I add the new columns after the TemplateColumns, everything works fine. But when I insert the columns into the beginning of the GridView's columns...
I won't be returning anything in the event of the exception--I'll be throwing another exception--so should I really be pretending that I might return that uninitialized value? Setting the return values to null (duh!) is definitely better than anything I'd thought of, but it still isn't...
In my SQL data access layer in a VB 2005 class library, I have a few blocks which fit the following pattern:
try
execute SQL command
catch DataException
process exception (log it, etc.)
generate and throw new DataException
(with the original exception as an inner exception)...
I'm trying to use the debugger to step through some unit tests I wrote for an ASP.NET 2.0 web service. Unfortunately, I can't get the debugger to hit any of my breakpoints. It flys right by breakpoints in both the unit test code and the code in the web service project. If it matters, I'm not...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.