DetailsView looses EditMode

A

Andreas Wöckl

HI Group!

I am really getting crazy with my DetailsView. I have the following code
initializing the Page where the DetailsView is in it:

If Session("firmaNr") = 0 Then
Me.dv_firma.ChangeMode(DetailsViewMode.Insert)
Me.dv_kontaktperson.ChangeMode(DetailsViewMode.Insert)
Else
Me.dv_firma.ChangeMode(DetailsViewMode.Edit)
Me.dv_kontaktperson.ChangeMode(DetailsViewMode.Edit)
End If

So my problem is that after a few minutes the DetailsView seems to change
the mode to "Insert" - The user does not recognize this and still has his
button to save the current values. The result is a HTTP Exception that says
"The DetailsView has to be in edit mode..."
Exception Trace:

System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg,
Boolean causesValidation)
bei System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean
causesValidation, String validationGroup)
bei System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source,
EventArgs e)
bei System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
bei System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source,
EventArgs e)
bei System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
bei System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
bei System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument)
bei
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
bei System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
bei System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
bei System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Anyone an idea what's going wrong here..?

best regards
andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top