DetailsView gives a blank page on update

Discussion in 'ASP .Net Web Controls' started by chuck wyatt, Jul 7, 2006.

  1. chuck wyatt

    chuck wyatt Guest

    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>
     
    chuck wyatt, Jul 7, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wardy
    Replies:
    0
    Views:
    362
    wardy
    Mar 20, 2007
  2. Mario
    Replies:
    0
    Views:
    363
    Mario
    Mar 2, 2009
  3. Cal Who
    Replies:
    5
    Views:
    836
    Cal Who
    Dec 3, 2009
  4. Feege
    Replies:
    0
    Views:
    459
    Feege
    Dec 20, 2005
  5. Replies:
    10
    Views:
    311
    Thomas 'PointedEars' Lahn
    Feb 16, 2006
Loading...

Share This Page