.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

User Update doesnt update the record

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net

For right now, the View Account for an individual user has the following setup on the aspx page.


        <table style="width:90%;">
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="UserName" DataSourceID="ObjectDataSource2" ondatabound="DetailsView1_DataBound" Width="50%">
                            <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="true" SortExpression="UserName" />
                            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                            <asp:CommandField ShowEditButton="True" />
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetMembers" TypeName="MembershipUtilities.MembershipUserODS" UpdateMethod="Update" OldValuesParameterFormatString="{0}&

View Complete Post

More Related Resource Links

update user status in database when ever user logoff


actually i came across this senario for new project where userstatus must change to log off when ever he do fallowing activity.I have maintain user status when he log in to web based system.

Activities are


1.user click log off

2.or user click browser close button or close brwoser tab.

3.or Fource fully shut down his Pc

I am able to get first 2 but not the last one.I googled it but not get any satified ans for that.

I m looking for guidens for this. Any help is grate help for me as i want it.And also other suggesstion also welcomed.

thanks in advance


How can i update treeview root node every time based on the record entries

Hi all, I will have an mdi form and with a treeview which has it's initial property as visible =false. If i select an option from menu a child form will exists i will fill some details and click on save when ever click on save i will make the root node of the treeview to some name as File[batch count:0]. Now if i select another option from menu another form will appear and if i fill it with some details and click on save i would like to change the root node name to File[batch count:1] and a child node should exists with some name

Update Database Record using GridView and Stored Procedure

Hi, I am trying to update record via stored procedure, but i got error at very start point. Problem is when i click on Edit link button within the Gridview it produce error. I can populate values from database fine but its produce error when i click on edit link button. Please see the code below. *********** ASP.net GridView Code I am using *****************<asp:GridView ID="GridView1" runat="server" DataKeyNames="RollID, EmpID" AutoGenerateColumns="False" Width="700px"> <Columns> <asp:TemplateField HeaderText="ApplicationID" Visible="false"> <ItemTemplate> <asp:Label ID="AppsID" runat="server" Visible="false"><%# Eval("RollID") %>'</asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ReleaseID" Visible="false"> <ItemTemplate> <asp:Label ID="rlsID" runat="server" Visible="false"><%# Eval("EmpID") %></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Roll Name"> <ItemTemplate> <asp:Label ID="rlsVersion" runat="server"><%# Eval("Roll_Name")%></asp:Label> </ItemTemplate> <EditI

DetailsView error "must be in edit mode to update a record" when I have set edit mode in code behind

Hi,I have a DetailsView within an UpdatePanel.  I programmatically put the DetailsView into edit mode, change the fields then call the UpdateItem method which causes the "must be in edit mode to update a record" exception.  Am I missing something blindingly obvious? <asp:UpdatePanel ID="upSpecificShout" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" > <ContentTemplate> <asp:DetailsView ID="dvSingleShout" DataSourceID="sdsSingleShout" runat="server" AutoGenerateRows="false" OnDataBound="SetDVIcons" HeaderStyle-CssClass="noDisplay" DefaultMode="ReadOnly" AutoGenerateEditButton="true" OnItemCommand="dvItemCommand"> <fields> <asp:TemplateField ShowHeader="false"> <ItemTemplate> <asp:Panel ID="dlSpecificDetailsViewPanel" runat="server" CssClass="i_am_a_shout"> <h2><asp:LinkButton ID="lblShoutTitle" runat="server" Text='<%# Bind("Shout_Title") %>' On

Update a record in a table?

HiI've been playing around with MVC lately, and was wondering how you could do this:I have a view that displays a list of products, and against each product is a list of categories (in a combobox). I'm trying to find out how you can update a product's category when you select a category in the list. I know you could do something fairly simple with jQuery, but I'm trying to understand how submitting forms works with MVC.Here's what I currently have:// Controller public ActionResult Index() { List<Product> products = _productRepository.GetProducts(); List<ProductCategory> categories = _productRepository.GetCategories(); ProductsViewModel viewModel = new ProductsViewModel { Products = products, ProductCategories = new SelectList(categories, "Id", "Description") }; return View(viewModel); } // ViewModel public class ProductsViewModel { public List<Product> Products { get; set; } public SelectList ProductCategories { get; set; } } // View <% using (Html.BeginForm()) { %> <table> <tr> <th>Id</th> <th>Description</th> <th>Category</th> </tr> <% foreach (var product in Model.Products) { %> <tr> <td><%: product.Id%></td> <td><%:

How to determine if a user control is contained by the update panel that triggered async postback

Does anyone know a simple way to determine if a user control is contained in an update panel that was triggered for async postback?At the moment, the only pseudo logic for this I can think of is?'Loop through the update panel controls on the page and find the one that is involved in the postback (isInPartialRendering)'Try to find the user control as a child of the update panel

Gridview Record Update Problum


How can I Edit and update record in Gridview using viserd..

in asp.net c#

User Control with JQuery doesnot work inside update panel


Hi All,

I created a .NET user control to work as a DropdownCheckbox and added Jquery to give the sliding and hide effects. The code is as below:

 <script language="javascript" type="text/javascript">
        var showRegionWindow = function (ev) {
            var pos = $("#lnkChangeRegion").offset();
            var width = 230;
            var height = 55;
            //$("#changeRegionPanel").css({ "left": +((pos.left) - 215) + "px", "top": height + 16 + "px" });.
            document.getElementById("lnkChangeRegion").style.display = 'none';

        var hideRegionWindow = function (ev) {
            var textVal = "";

Update a record in a SharePoint list using web services


Hi all,

I am trying to update one field in a record on a SharePoint list. I am using the code below to do this. The thing is it is tossing an error:

Unexpected end of file has occurred. The following elements are not closed: Method. Line 1, position 29.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: Method. Line 1, position 29.

Source Error:

Line 791:
Line 792:    /* Update the inspire field to exported*/
Line 793:    batchElement.InnerXml += "<Method ID='1' Cmd='Update'>";

Line 794:    batchElement.InnerXml += "<Field Name='ID'>6</Field>";
Line 795:    batchElement.InnerXml += "<Field Name='inpsire'>new</Field>";

As I understand; I create a method and then cmd update. I then give the ID of the record th

Problem with User Control, Update panel and flicker


I have  block of code that consists of a textbox a button and a dropdown. The text entered in the text box filters the dropdownlist when the user clicks the button. The Ajax works great when it is in a simple page but if I put the same code in a User control I get flicker. Can anyone assist with this issue?

Update all Properties in the User Information List after restoring a site collection to a new domain


hi All

I moved a site collection (content db) from one domain to another. After the site collection was restored i ran the stsadm -o migrateuser -oldlogin -newlogin. The result was that the login id of the user in the source domain was replaced with the login in the destination domain.

However the rest of the properties in the User Information List (paricularly interested in the Email) was not updated.

How can i get all the properties in the User Information List with values in the new domain

Thanks in Advance


Update user profile


I am new to asp.net. 

I am designing a page to let the user to edit and update his own profile. How can I control a user so that he can only change his own profile?

Thanks very much

Unable to Edit & Update user Profile Information

I Have a sharepoint Site.. I am trying to configure alter in the site..But Email ID are not available bel for all the users..I tried to Update the user Profile info by clicking the edit Item button in the user profile information.But it is not showing any editable content...It is just showing user NTlogin?This site is not connected to active directory.. We are adding users manually..How to update user details?

problem with user control+update panel+javascript


hai all,


Im having a aspx page which has 5 tabs inside a update panel..also I have a user control

Wen I click each tab im dynamically loading dat user control .

The problem is im using javascript in dat user control..

the user control has a button which displays a panel containing three grid views  n s activated by a java script as given below..

function Elig()



'<%=btnLegend.ClientID %>')).click(function(){


('<%=pBody.ClientID %>')).slideToggle('slow');




Wen i run the aspx page the first tab  successfully loaded with dat user control n a

Update User Profile info from another SharePoint site


Hi All,

I have MOSS 2007 up and running, and the Staff Profile is maintained by the users.

Now there is another NEW sharepoint 2010 apps planning. In order to avoid the duplication of staff profile in SharePoint 2010, the requirement is to update the SharePoint 2010 Staff Profile from the existing MOSS 2007.

Is it possible? Any help.


Why does this update every record


I know this has worked in the past. But running this now updates every record instead of just the requested date range. Any idea why?

UPDATE  License
SET       Version = 8
             (SELECT   License_1.Version
              FROM     Person INNER JOIN
                          Company ON Person.CompanyId = Company.companyId INNER JOIN
                          License AS License_1 ON Person.PersonId = License_1.CustomerId
              WHERE   (Company.anniversary >= '7/1/2009'))

What's really weird is I can change the inequality and it still updates all records.

??? - thanks - dave

Very funny video - What's your Metaphor?

Cannot update record to database



I encounter some problems on updating the database record and want to find some help. I use the following coding to show a form for receiving the original record and it works:

    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.userID) %>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.userID) %>
                <%= Html.ValidationMessageFor(model => model.userID) %>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.username) %>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.username) %>
                <%= Html.ValidationMessageFor(model => model.username) %>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.password) %>
            <div class="editor-field">
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend