Hi Marc,
As for the error you encountered, it is because Wizard control is not a
databound control(such as Gridview, FormView or dropdownlist...).
Therefore, Wizard control does not support databinding expression directly
located in its member template. The "DataBind" method you mentioned is
used for simple databind(for Wizard control's own properties) e.g.
=============
<asp:Wizard ID="Wizard1" ... Width='<%# ..... %>' Height='<%#
....%>' >
....
==========
If you do need to use databinding to populate controls in Wizard, I think
you may consider put a databound template control inside Wizard control's
step so as to wrapper other controls that need databinding. How do you
think?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we
can improve the support we provide to you. Please feel free to let my
manager know what you think of
the level of service provided. You can send feedback directly to my manager
at:
(E-Mail Removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response
from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take
approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump
analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support
Engineer by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?TWFyY0c=?= <(E-Mail Removed)>
>Subject: databind asp.net wizard control
>Date: Thu, 6 Mar 2008 07:53:02 -0800
>
>I want to use a asp.net wizard control to help the user enter fields for a
>single complex record. The idea is for each page to solicit data for a
subset
>of the fields and at the end do the update.
>
>The wizard has a DataBind method, but I can't find a way to associate the
>SqlDataSource on the page with the wizard control itself.
>
>In the aspx I have...
>
> <asp:Wizard ID="surveyDescrWizard" runat="server" Width="800px">
> .....
> <WizardSteps>
> <asp:WizardStep runat="server" Title="Page 2">
> Title:
> <asp:Literal ID="Literal1" runat="server"
>Text="LiteralText"></asp:Literal>
> <asp:TextBox ID="TextBox1" runat="server"
>BorderStyle="Double" Text='<%# Bind("Title") %>'></asp:TextBox>
> </asp:WizardStep>
> </WizardSteps>
> </asp:Wizard>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ...>
> ....
> </asp:SqlDataSource>
>
>In my page load event I have...
> if (!IsPostBack)
> {
> surveyDescrWizard.DataBind();
> }
>
>I get the exception ...
> "Databinding methods such as Eval(), XPath(), and Bind() can only be
used
>in the context of a databound control."
>
>On reflection (so to speak) this makes perfect sense since there is no
>property or method that lets you associate the datasource with the wizard
>itself.
>
>Since the Wizard control offers a DataBind() method, there must be some
way
>to do this, but I just can't see it.
>
>Thx
>Marc
>