DetailsView Update Problem
-
Hi to all, I am using DetailsView control to edit the details of the user. But when I click the Edit button, the update button is not clickable. I am unable to find out the problem.
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Height="50px" Width="364px" AutoGenerateEditButton="True" DataKeyNames="UserId" style="margin-right: 0px" onitemupdating="DetailsView1_ItemUpdating"> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <Fields> <asp:BoundField DataField="UserId" HeaderText="UserId" ReadOnly="True" SortExpression="UserId" /> <asp:BoundField DataField="first_name" HeaderText="first_name" SortExpression="first_name" /> <asp:BoundField DataField="last_name" HeaderText="last_name" SortExpression="last_name" /> <asp:BoundField DataField="AddressLine1" HeaderText="address1" SortExpression="AddressLine1" /> <asp:BoundField DataField="AddressLine2" HeaderText="address2" SortExpression="AddressLine2" /> <asp:BoundField DataField="AddressLine3" HeaderText="address3" SortExpression="AddressLine3" /> <asp:BoundField DataField="zipcode" HeaderText="zipcode" SortExpression="zipcode" /> <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" /> <asp:BoundField DataField="state" HeaderText="state" SortExpression="state" /> <asp:BoundField DataField="country" HeaderText="country" SortExpression="country" /> <asp:BoundField DataField="landline" HeaderText="landline" SortExpression="landline" /> <asp:BoundField DataField="mobile" HeaderText="mobile" SortExpression="mobile" />
-
Hi to all, I am using DetailsView control to edit the details of the user. But when I click the Edit button, the update button is not clickable. I am unable to find out the problem.
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Height="50px" Width="364px" AutoGenerateEditButton="True" DataKeyNames="UserId" style="margin-right: 0px" onitemupdating="DetailsView1_ItemUpdating"> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <Fields> <asp:BoundField DataField="UserId" HeaderText="UserId" ReadOnly="True" SortExpression="UserId" /> <asp:BoundField DataField="first_name" HeaderText="first_name" SortExpression="first_name" /> <asp:BoundField DataField="last_name" HeaderText="last_name" SortExpression="last_name" /> <asp:BoundField DataField="AddressLine1" HeaderText="address1" SortExpression="AddressLine1" /> <asp:BoundField DataField="AddressLine2" HeaderText="address2" SortExpression="AddressLine2" /> <asp:BoundField DataField="AddressLine3" HeaderText="address3" SortExpression="AddressLine3" /> <asp:BoundField DataField="zipcode" HeaderText="zipcode" SortExpression="zipcode" /> <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" /> <asp:BoundField DataField="state" HeaderText="state" SortExpression="state" /> <asp:BoundField DataField="country" HeaderText="country" SortExpression="country" /> <asp:BoundField DataField="landline" HeaderText="landline" SortExpression="landline" /> <asp:BoundField DataField="mobile" HeaderText="mobile" SortExpression="mobile" />
Hi Sneha , Be little more specific what is the problem
-
Hi Sneha , Be little more specific what is the problem
Hi Nishant, In the edit mode of the details view we have two buttons, update and cancel. Cancel is working fine. But the update button is not working.It is not clickable. Nothing is happening when I click on it. I even created a new page and applied the same code but of no use. I used details view several times but this time I am not able to solve the problem. If it is not updating the data, I can understand but the update button is not clickable is a strange behaviour.
cheers, sneha
-
Hi Nishant, In the edit mode of the details view we have two buttons, update and cancel. Cancel is working fine. But the update button is not working.It is not clickable. Nothing is happening when I click on it. I even created a new page and applied the same code but of no use. I used details view several times but this time I am not able to solve the problem. If it is not updating the data, I can understand but the update button is not clickable is a strange behaviour.
cheers, sneha
Got the problem .....but not sure what exactly is causing the problem , Have u associated any event with update Command , or just check anywhere it is getting disabled or something in Control Render events.
-
Hi Nishant, In the edit mode of the details view we have two buttons, update and cancel. Cancel is working fine. But the update button is not working.It is not clickable. Nothing is happening when I click on it. I even created a new page and applied the same code but of no use. I used details view several times but this time I am not able to solve the problem. If it is not updating the data, I can understand but the update button is not clickable is a strange behaviour.
cheers, sneha
-
Got the problem .....but not sure what exactly is causing the problem , Have u associated any event with update Command , or just check anywhere it is getting disabled or something in Control Render events.
I checked the page source. I think here is the problem. The update button is this:
<a href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$DetailsView1$ctl12", "", true, "", "", false, true))" style="color:#333333;">Update</a>
I think it should be:<a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$DetailsView1$ctl12','')" style="color:Black;">Update</a>
cheers, sneha