how to make message appear after record is inserted?

J

Jan

Hello,

Just after the new record is inserted in the database using a Detailsview
control, i would like to display a short message "the record is inserted".
In the aspx file, i defined a hiddenfiekd:
<asp:HiddenField ID="HiddenField1" runat="server" Visible="false" />

In the code-behind:
Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertedEventArgs) Handles
DetailsView1.ItemInserted
HiddenField1.Visible = True
HiddenField1.Value = "record inserted"
End Sub


My problem is that nothing appears. It's due to the automatic postback, i
think. Any way to make the message visible?

Thanks
Jan
 
S

Scott M.

A hidden form field can never be visible (hence its name). Use a label
control.
 
J

Jan

Yes, this works.Thanks.
Is there any explanation why it doesn't with a hiddenfield?
 
B

Bob Lehmann

Is there any explanation why it doesn't with a hiddenfield?
Because it's hidden.

Bob Lehmann
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top