Solved

DetailsView edit page

Posted on 2011-03-09
1
529 Views
Last Modified: 2012-05-11
HI EE,

I have page DetailsView and ObjectDataSource. when I hit "edit" DetailsView, on the Sectors filed,
I want to create new query to display all sector list with CheckBoxList and check on the selected sectors.

And when I update the newly selected sectors should be updated!

pls help, how can I do it!

Thank you

<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" 
        DataSourceID="ObjectDataSource1" EnableModelValidation="True" 
        AutoGenerateRows="False" DataKeyNames="PubContactID">
        <Fields>
            <asp:BoundField DataField="PubContactID" HeaderText="PubContactID" 
                InsertVisible="False" ReadOnly="True" SortExpression="PubContactID" />
            <asp:BoundField DataField="ContactName" HeaderText="ContactName" 
                SortExpression="ContactName" />
            <asp:BoundField DataField="ContactPhone" HeaderText="ContactPhone" 
                SortExpression="ContactPhone" />
            <asp:BoundField DataField="ContactEmail" HeaderText="ContactEmail" 
                SortExpression="ContactEmail" />
            <asp:BoundField DataField="ContactCity" HeaderText="ContactCity" 
                SortExpression="ContactCity" />
            <asp:BoundField DataField="ContactNotes" HeaderText="ContactNotes" 
                SortExpression="ContactNotes" />
            <asp:BoundField DataField="PublicID" HeaderText="PublicID" 
                SortExpression="PublicID" />
            <asp:BoundField DataField="Sectors" HeaderText="Sectors" 
                SortExpression="Sectors" />             
            <asp:CommandField ShowEditButton="True" />
        </Fields>
    </asp:DetailsView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetSubPublicationDetails" TypeName="DataAccess" 
        UpdateMethod="UpdateSubPublicationDetails" 
        onupdated="ObjectDataSource1_Updated">
        <SelectParameters>
            <asp:QueryStringParameter Name="PubID" QueryStringField="id" Type="Int32" 
                DefaultValue="" />
            <asp:QueryStringParameter DefaultValue="eng" Name="lang" 
                QueryStringField="lang" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="ContactPhone" Type="String" />
            <asp:Parameter Name="ContactEmail" Type="String" />
            <asp:Parameter Name="ContactCity" Type="String" />
            <asp:Parameter Name="ContactNotes" Type="String" />
            <asp:Parameter Name="Sectors" Type="String" />
            <asp:Parameter Name="PublicID" Type="Int32" />
            <asp:Parameter Name="PubContactID" Type="Int32" />
        </UpdateParameters>
</asp:ObjectDataSource>

Open in new window

0
Comment
Question by:saloj
1 Comment
 
LVL 13

Accepted Solution

by:
agarwalrahul earned 500 total points
ID: 35091856
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question