CreateUserWizard Error Messages using a ContentTempate
In our latest project we are implementing Membership, Roles and Profiles. I've used these before, but never really had the need to exploit all the features.
The business requirements of the system have meant that I have had to implement a custom CreateUserWizard ContentTemplate, which is great feature of the control. I can set all of the error message properties, but I just couldn't work out how to get my custom error text onto the screen. I even tried putting code into the OnCreateUserError event to trap an error and display the error text, and this doesn't work because the error text in the event isn't what you specified in the control.
After trawling the web, I found the solution.
<asp:Literal runat="server" EnableViewState="false" ID="ErrorMessage"></asp:Literal>
The Control must look for this literal when it is in error, and populates it.
How easy was that?!
I'd normally close by suggesting a beer, but its too early on a sunday..
Hope this helps someone.
A self confessed Microsoft bigot, Paul loves all Microsoft products with a particular fondness for SQL Server. Paul is currently focusing on Web 2.0 patterns and practices and is always looking for better ways of doing things.
I love the .net platform, and I find it to be the most productive toolset I have used to date.