473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

asp:Wizard inside of a asp:FormView breacks two-way databinding (Round 4)

Earlier this month, there was a posting about this without a definitive
answer.

If you place a Wizard inside a FormView's EditItemTemplate the bound fields
contained within the View will display the data from the fields to which
they are bound; yet they will return null values when the 'Update'
LinkButton is clicked.

The responder thought this might have something to do with naming
containers. If so, this is similar to an issue in Beta 2, Bug ID:
FDBK27772,
http://lab.msdn.microsoft.com/Produc...1-7e93b1d52077,
with naming containers (multiview, panel, etc) and fixed in a later build.

I checked, and it is works with MultiView.

Did the fix miss the Wizard or does this have nothing to do with naming
containers?

I want to use the built-in features of the Wizard rather than create my own
using MultiView.

Doug
Feb 3 '06 #1
6 2046
Hi Doug,

Thanks for posting!

For the current issue, my understanding is that the Wizard control has the
same problem with the MultiView control when place it into the FormView
control. If I have misunderstood anything, please let me know.

In this scenario, could you please give me a simple demo which can
reproduce the current problem? This will help me to perform the same test
exactly. I appreciate your understanding!

In addition, the Wizard control is the naming container control. So if some
naming container controls is fixed, I think the Wizard control also should
be fixed. That's why I need perform some tests. Thanks for your
understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 6 '06 #2
Hi Yuan,

With the code below, try to update the Company Name with the Wizard and
MultiView examplex. The Wizard example post backs nulls.

Add a connection string to Web.config

<add name="LocalNWind"
connectionString="SERVER=(local);DATABASE=northwin d;INTEGRATED
SECURITY=sspi;" providerName="System.Data.SqlClient"/>

Multiview Example that works:
---------------------------------------------- MultiView Form after
here -------------------------------------------------------------------------
<form id="form1" runat="server">

<div>

<asp:FormView

ID="FormView1"

runat="server"

AllowPaging="true"

DataSourceID="SqlDataSource1"

DataKeyNames="CustomerID"

<ItemTemplate>

<TABLE border="1">

<TR>

<TD>

Company Name:

</TD>

<TD>

<asp:literal ID="litCompanyName" runat="server" Text='<%#
Eval("CompanyName") %>' />

</TD>

</TR>

<TR>

<TD>

Contact Name:

</TD>

<TD>

<asp:literal ID="litContactName" runat="server" Text='<%#
Eval("ContactName") %>' />

</TD>

</TR>

<TR>

<TD>

<asp:Button id="btnEdit" runat="server" text="Edit" CommandName="Edit"/>

</TD>

</TR>

</TABLE>

</ItemTemplate>

<EditItemTemplate>

<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">

<asp:View ID="View1" runat="server">

<TABLE border="1">

<TR>

<TD>

Company Name:

</TD>

<TD>

<asp:TextBox ID="txtCompanyName" runat="server" Text='<%#
Bind("CompanyName") %>' />

</TD>

</TR>

</TABLE>

</asp:View>

<asp:View ID="View2" runat="server">

<TABLE border="1">

<TR>

<TD>

Contact Name:

</TD>

<TD>

<asp:TextBox ID="txtContactName" runat="server" Text='<%#
Bind("ContactName") %>' />

</TD>

</TR>

</TABLE>

</asp:View>

</asp:MultiView>

<TABLE>

<TR>

<TD colspan="2">

<asp:Button id="btnUpdate" runat="server" text="Update"
CommandName="Update"/>

<asp:Button id="btnCancel" runat="server" text="Cancel"
CommandName="Cancel"/>

</TD>

</TR>

</TABLE>

</EditItemTemplate>

</asp:FormView>

<asp:SqlDataSource ID="SQLDataSource1" runat="server"

EnableCaching="True"

ConnectionString='<%$ ConnectionStrings:LocalNWind %>'

SelectCommand="SELECT CustomerID, CompanyName, ContactName FROM Customers"

UpdateCommand="UPDATE Customers SET CompanyName = @CompanyName, ContactName
= @ContactName WHERE CustomerID = @CustomerID">

<UpdateParameters>

<asp:Parameter Name="CustomerID" />

<asp:Parameter Name="CompanyName" />

<asp:Parameter Name="ContactName" />

</UpdateParameters>

</asp:SqlDataSource>
</div>

</form>

---------------------------------------------- MultiView Form before
here -------------------------------------------------------------------------

Wizard Example that does not work:
---------------------------------------------- Wizard Form after
here -------------------------------------------------------------------------
<form id="form1" runat="server">

<div>

<asp:FormView

ID="FormView1"

runat="server"

AllowPaging="true"

DataSourceID="SqlDataSource1"

DataKeyNames="CustomerID"

<ItemTemplate>

<TABLE border="1">

<TR>

<TD>

Company Name:

</TD>

<TD>

<asp:literal ID="litCompanyName" runat="server" Text='<%#
Eval("CompanyName") %>' />

</TD>

</TR>

<TR>

<TD>

Contact Name:

</TD>

<TD>

<asp:literal ID="litContactName" runat="server" Text='<%#
Eval("ContactName") %>' />

</TD>

</TR>

<TR>

<TD>

<asp:Button id="btnEdit" runat="server" text="Edit" CommandName="Edit"/>

</TD>

</TR>

</TABLE>

</ItemTemplate>

<EditItemTemplate>

<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="115px">

<WizardSteps>

<asp:WizardStep ID="WizardStep1" runat="server" Title="Company Name">

<TABLE border="1">

<TR>

<TD>

Company Name:

</TD>

<TD>

<asp:TextBox ID="txtCompanyName" runat="server" Text='<%#
Bind("CompanyName") %>' />

</TD>

</TR>

</TABLE>

</asp:WizardStep>

<asp:WizardStep ID="WizardStep2" runat="server" Title="Contact Name">

<TABLE border="1">

<TR>

<TD>

Contact Name:

</TD>

<TD>

<asp:TextBox ID="txtContactName" runat="server" Text='<%#
Bind("ContactName") %>' />

</TD>

</TR>

</TABLE>

</asp:WizardStep>

</WizardSteps>

<SideBarTemplate>

<asp:DataList ID="SideBarList" runat="server">

<SelectedItemStyle Font-Bold="True" />

<ItemTemplate>

<asp:LinkButton ID="SideBarButton" runat="server"></asp:LinkButton>

</ItemTemplate>

</asp:DataList>

</SideBarTemplate>

</asp:Wizard>

<TABLE>

<TR>

<TD colspan="2">

<asp:Button id="Button1" runat="server" text="Update" CommandName="Update"/>

<asp:Button id="Button2" runat="server" text="Cancel" CommandName="Cancel"/>

</TD>

</TR>

</TABLE>

</EditItemTemplate>

</asp:FormView>

<asp:SqlDataSource ID="SQLDataSource1" runat="server"

EnableCaching="True"

ConnectionString='<%$ ConnectionStrings:LocalNWind %>'

SelectCommand="SELECT CustomerID, CompanyName, ContactName FROM Customers"

UpdateCommand="UPDATE Customers SET CompanyName = @CompanyName, ContactName
= @ContactName WHERE CustomerID = @CustomerID">

<UpdateParameters>

<asp:Parameter Name="CustomerID" />

<asp:Parameter Name="CompanyName" />

<asp:Parameter Name="ContactName" />

</UpdateParameters>

</asp:SqlDataSource>
</div>

</form>

---------------------------------------------- Wizard Form before
here -------------------------------------------------------------------------

""Yuan Ren[MSFT]"" <v-****@microsoft.com> wrote in message
news:Kz**************@TK2MSFTNGXA02.phx.gbl... Hi Doug,

Thanks for posting!

For the current issue, my understanding is that the Wizard control has the
same problem with the MultiView control when place it into the FormView
control. If I have misunderstood anything, please let me know.

In this scenario, could you please give me a simple demo which can
reproduce the current problem? This will help me to perform the same test
exactly. I appreciate your understanding!

In addition, the Wizard control is the naming container control. So if
some
naming container controls is fixed, I think the Wizard control also should
be fixed. That's why I need perform some tests. Thanks for your
understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 6 '06 #3
Hi Doug,

Thanks for your reply!

I have performed the test and reproduced the current issue. I think maybe
the bug is not totally fixed for all naming container control. I suggest
you open a new case to the Microsoft PSS. Since the issue maybe is caused
by the product bug, you will not be charged for the case. The Microsoft PSS
will supply the workaround or hot fix for the current issue.

For your reference, I attached steps to contact Microsoft PSS here: You can
contact Microsoft Product Support directly to discuss additional support
options you may have available, by contacting us at 1-(800)936-5800 or by
choosing one of the options listed at
http://support.microsoft.com/common/...gp;en-us;offer
prophone

I appreciate your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 8 '06 #4
Hi Yuan,

I have opened a case with PSS.

Initial reaction from them is that it is a bug.

Thanks,

Doug

""Yuan Ren[MSFT]"" <v-****@microsoft.com> wrote in message
news:uc*************@TK2MSFTNGXA01.phx.gbl...
Hi Doug,

Thanks for your reply!

I have performed the test and reproduced the current issue. I think maybe
the bug is not totally fixed for all naming container control. I suggest
you open a new case to the Microsoft PSS. Since the issue maybe is caused
by the product bug, you will not be charged for the case. The Microsoft
PSS
will supply the workaround or hot fix for the current issue.

For your reference, I attached steps to contact Microsoft PSS here: You
can
contact Microsoft Product Support directly to discuss additional support
options you may have available, by contacting us at 1-(800)936-5800 or by
choosing one of the options listed at
http://support.microsoft.com/common/...gp;en-us;offer
prophone

I appreciate your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 8 '06 #5
Hi Doug,

You are welcome:)

Yuan Ren [MSFT]
Microsoft Online Support

Feb 9 '06 #6
Hi,

I am also using asp:formview - but instead of using the wizardstep I am using the control asp:multivew - I haven't perfected the whole process yet - but it does work - i.e. you can step through various views etc and pull data from a db.
If you want an example - respond to this post.
Apr 27 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John Bailey | last post by:
I have a web page with a formview, and a multiview in the formview. When I databind the values inside the multiview views, there is no option for two-way databinding. The form populates fine, but...
1
by: dieter | last post by:
Two-way databinding (as described in http://dotnetjunkies.com/QuickStartv20/aspnet/doc/data/templates.aspx) works fine for me if I use it within aspx-files. However, I would like to use it my...
2
by: John R. Lewis | last post by:
I posted this yesterday with a different email address. I am reposting with my fake-address as given to me by Microsoft so that I can be guraranteed a response from a support representative. Sorry...
0
by: Douglas J. Badin | last post by:
Earlier this month, there was a posting about this without a definitive answer. If you place a Wizard inside a FormView's EditItemTemplate the bound fields contained within the View will display...
0
by: Douglas J. Badin | last post by:
Earlier this month, there was a posting about this without a definitive answer. If you place a Wizard inside a FormView's EditItemTemplate the bound fields contained within the View will display...
2
by: Toma Marinov | last post by:
Hello ! My question is about the Two-Way DataBinding in Win Forms VS.2005 (C# or VB.Net). I mean the process when the value was updated in the control and this change must be reflected in the...
1
by: cab0san | last post by:
Is it possible to use a publicly scoped string vaiable as an argument to the bind method? A normal bind method works like this: <asp:TextBox ID="TextBox1" runat="server" Text='<%#...
0
by: EricLondaits | last post by:
Hi, I have an ASP.NET page with a ListBox that is data bound to a table with a single field (it holds a list of valid IDs). The page also has a textBox into which you can add new valid IDs, one...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.