Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2008, 05:10 AM
Registered User
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gopalawaghate
Default regarding the dropdownlist in the details view

Dear all
                  I have taken one details view .
################## aspx code ###########

<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="ObjectDataSource1"

Height="74px" Width="484px" AutoGenerateRows="False" AllowPaging="True">

<Fields>



<asp:TemplateField ShowHeader="False">

<EditItemTemplate>

<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="True"

CommandName="Update" ImageUrl="~/images/add_user.JPG" Text="Update" />

 <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False"

CommandName="Cancel" ImageUrl="~/images/btn_cancel.gif" Text="Cancel" />

</EditItemTemplate>

<ItemTemplate>

<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False"

CommandName="Edit" CommandArgument="edit" ImageUrl="~/images/edit.gif" Text="Edit" />

</ItemTemplate>

</asp:TemplateField>

<asp:BoundField DataField="userid" HeaderText="userid" />

<asp:TemplateField HeaderText="firstname">

<EditItemTemplate>

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

</EditItemTemplate>

<InsertItemTemplate>

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

</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="Label4" runat="server" Text='<%# Bind("firstname") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:BoundField DataField="lastname" HeaderText="Last name" />

<asp:BoundField DataField="email" HeaderText="Email" />

<asp:BoundField DataField="password" HeaderText="Pasword" />

<asp:BoundField DataField="profileid" HeaderText="profileid" />

<asp:BoundField DataField="designation" HeaderText="designation" />

<asp:BoundField DataField="teamid" HeaderText="teamid" />



<asp:TemplateField HeaderText="Username">

<EditItemTemplate>

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

<asp:RequiredFieldValidator ControlToValidate="TextBox2" ID="RequiredFieldValidator1" runat="server"

ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

</EditItemTemplate>

<InsertItemTemplate>

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

</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="Label3" runat="server" Text='<%# Bind("username") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>


<asp:TemplateField HeaderText="Role">

<EditItemTemplate>


<asp:DropDownList ID="dropdownlistrole" runat="server" DataTextField="role" DataValueField="roleid">


</asp:DropDownList>

</EditItemTemplate>

<InsertItemTemplate>

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


</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%# Bind("roleid") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField>

<EditItemTemplate>

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

</EditItemTemplate>

<InsertItemTemplate>

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

</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="Label2" runat="server" Text='<%# Bind("roleid") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

</Fields>

</asp:DetailsView>


<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"

SelectMethod="GetList" TypeName="ALIAManager.clsUserBL"

UpdateMethod="UpdateData">

<UpdateParameters>

<asp:Parameter Name="userid" Type="Int64" />

<asp:Parameter Name="firstname" Type="String" />

<asp:Parameter Name="lastname" Type="String" />

<asp:Parameter Name="email" Type="String" />

<asp:Parameter Name="username" Type="String" />

<asp:Parameter Name="password" Type="String" />

<asp:Parameter Name="profileid" Type="String" />

<asp:Parameter Name="designation" Type="String" />

<asp:Parameter Name="teamid" Type="String" />

<asp:ControlParameter Direction="Output" Name="roleid" Type="String" PropertyName="selectedvalue" ControlID="DetailsView1$dropdownlistrole" />


</UpdateParameters>

<SelectParameters>

<asp:Parameter Name="SearchFilter" Type="String" />

</SelectParameters>


</asp:ObjectDataSource>

##############################

I am using business object to update the details view following is the function that is used in the code behind.

###############

Public Function UpdateData(ByVal userid As Int64, ByVal firstname As String, ByVal lastname As String, ByVal email As String, ByVal username As String, ByVal password As String, ByVal profileid As String, ByVal roleid As String, ByVal designation As String, ByVal teamid As String) As Boolean

Dim objdetails As New ALIABase.clsUser

objdetails = objdetails.adddetails(userid, firstname, lastname, email, username, password, profileid, roleid, designation, teamid)

Dim blnUpdate As Boolean

blnUpdate = AliaDAO.clsUserDAO.UpdateData(objdetails)

Return blnUpdate

End Function



#####################

I want to send the roleid to this function that is selectd in the dropdownlist .Fo that I have taken

<asp:ControlParameter Direction="Output" Name="roleid" Type="String" PropertyName="selectedvalue" ControlID="DetailsView1$dropdownlistrole" />

in the ubdate paramaeter section .But whenever I say update it will not get update with the value selected in the dropdownlist of the role.

Can u please give me solution .
 
Old September 26th, 2008, 02:23 AM
Registered User
 
Join Date: Jul 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

After Update you have to rebind the grid then you are able to see the changes.

Mohd Azharuddin Ansari
Syntel Inc
Pune





Similar Threads
Thread Thread Starter Forum Replies Last Post
details view parameter inungh ASP.NET 2.0 Basics 0 July 5th, 2008 08:48 PM
view details radheshsharma1032 .NET Framework 2.0 0 January 12th, 2008 10:06 AM
populate details view or list view non empty rows iinfoque ASP.NET 2.0 Basics 0 March 11th, 2007 06:11 AM
Regarding Details View aekta ASP.NET 2.0 Professional 0 March 10th, 2007 11:46 PM
Details View without Datasource harshaghanta ASP.NET 2.0 Professional 0 November 20th, 2006 09:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.