Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disappearing DetailsView with LinqDataSource

Status
Not open for further replies.

RenoirVandalet

Programmer
Sep 5, 2011
6
This is my first ASP.net project and all is going pretty well except that I have a DetailsView that disappears as soon as I click on the Edit button. I'm using a textbox with a textmode of "password" and if I remove the textbode it works. I'm sure this is something to do with postback, but I'm not familiar enough with web development to understand what. When the page first comes up, the user name and password are entered. Then a login button is clicked. At that point the password is blanked (default behavior) and then the DetailsView appears with an Edit button. If I click the Edit button, the DetailsView disappears. I'm attaching the page here as I'm not sure how to format code in these forums.
 
View this link to see how to add code to your posts:

As for your problem, since I don't have the code, I am assuming that in the code that fires when you edit the DetailsView, that you do not rebind the DetailsView. After any action performed on the DetailsView, sorting, paging, etc. you need to re-bind it to your datasource.
 
Ok, I was just able to view your code. No where do I see where you handle the ItemCommand event of the DetailsView.
Code:
  void DetailsViewTeachersLogin_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
     if (e.CommandName == "Edit")     {          
       //Your code here and then re-bind the DetailsView
    }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top