DetailsView gives a blank page on update

C

chuck wyatt

My problem is that when i press the update button on a detailsview i
get a blank page with no events being called. Not even page_load gets
called, nor does an exception get thrown. In the detailsview i have
autogenerateedit enabled and it does switch modes but no update. Im
using a tableadabter with all the insert/update/delete methods. So im
asking if anybody else has had this problem and how do i fix it.

code below

in cs file

protected void DetailsView1_ItemUpdating(object sender,
DetailsViewUpdateEventArgs e)
{
//never gets called by the update button
e.Cancel = false;
}

protected void DetailsView1_ItemUpdated(object sender,
DetailsViewUpdatedEventArgs e)
{
//never gets called by the update button
if (e.Exception != null)
{
//notifiy user

}
}

in aspx

Section Material<asp:DetailsView ID="DetailsView1"
runat="server" AllowPaging="True" AutoGenerateRows="False"
DataKeyNames="PageID" DataSourceID="MaterialDataSource"
Height="50px" Width="450px" OnDataBound="DetailsView1_DataBound"
OnItemUpdated="DetailsView1_ItemUpdated"
OnItemUpdating="DetailsView1_ItemUpdating">
<Fields>
<asp:BoundField DataField="PageID" HeaderText="PageID"
InsertVisible="False" ReadOnly="True"
SortExpression="PageID" Visible="False" />
<asp:BoundField DataField="SectionID"
HeaderText="SectionID" InsertVisible="False"
SortExpression="SectionID" Visible="False" />
<asp:BoundField DataField="PageNumber"
HeaderText="PageNumber" SortExpression="PageNumber" />
<asp:TemplateField HeaderText="PageTxt"
SortExpression="PageTxt">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Height="114px" Text='<%# Bind("PageTxt") %>'
TextMode="MultiLine"
Width="405px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Height="109px" Text='<%# Bind("PageTxt") %>'
TextMode="MultiLine"
Width="414px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("PageTxt") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True" ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:ObjectDataSource ID="MaterialDataSource" runat="server"
DeleteMethod="Delete" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData"
TypeName="CoursesDataSetTableAdapters.PagesTableAdapter"
UpdateMethod="Update">
<UpdateParameters>
<asp:parameter Name="PageID" Type="Object" />
<asp:parameter Name="SectionID" Type="Object" />
<asp:parameter Name="PageNumber" Type="Int32" />
<asp:parameter Name="PageTxt" Type="String" />
<asp:parameter Name="Original_PageID" Type="Object" />
</UpdateParameters>
<SelectParameters>
<asp:QueryStringParameter Name="SectionID"
QueryStringField="sectionid" Type="Object" />
</SelectParameters>
<InsertParameters>
<asp:parameter Name="PageID" Type="Object" />
<asp:parameter Name="SectionID" Type="Object" />
<asp:parameter Name="PageNumber" Type="Int32" />
<asp:parameter Name="PageTxt" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top