473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to make message appear after record is inserted?

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.DetailsViewInsertedEvent Args) 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
Mar 7 '07 #1
5 1615
Try using a label instead of a hiddenfield control

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Jan" <cbcbc@xcvxwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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.DetailsViewInsertedEvent Args) 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


Mar 7 '07 #2
A hidden form field can never be visible (hence its name). Use a label
control.
"David Wier" <da********@noSpamhotmail.comwrote in message
news:OY**************@TK2MSFTNGP04.phx.gbl...
Try using a label instead of a hiddenfield control

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Jan" <cbcbc@xcvxwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>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.DetailsViewInsertedEven tArgs) 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



Mar 7 '07 #3
Jan
Yes, this works.Thanks.
Is there any explanation why it doesn't with a hiddenfield?

"David Wier" <da********@noSpamhotmail.comschreef in bericht
news:OY**************@TK2MSFTNGP04.phx.gbl...
Try using a label instead of a hiddenfield control

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Jan" <cbcbc@xcvxwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>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.DetailsViewInsertedEven tArgs) 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



Mar 7 '07 #4
>Is there any explanation why it doesn't with a hiddenfield?
Because it's hidden.

Bob Lehmann

"Jan" <cbcbc@xcvxwrote in message
news:u5**************@TK2MSFTNGP04.phx.gbl...
Yes, this works.Thanks.
Is there any explanation why it doesn't with a hiddenfield?

"David Wier" <da********@noSpamhotmail.comschreef in bericht
news:OY**************@TK2MSFTNGP04.phx.gbl...
Try using a label instead of a hiddenfield control

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Jan" <cbcbc@xcvxwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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.DetailsViewInsertedEvent Args) 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



Mar 8 '07 #5
Jan
Of course ...
Thanks to all

"Bob Lehmann" <no****@dontbotherme.zzzschreef in bericht
news:ef*************@TK2MSFTNGP04.phx.gbl...
>>Is there any explanation why it doesn't with a hiddenfield?
Because it's hidden.

Bob Lehmann

"Jan" <cbcbc@xcvxwrote in message
news:u5**************@TK2MSFTNGP04.phx.gbl...
>Yes, this works.Thanks.
Is there any explanation why it doesn't with a hiddenfield?

"David Wier" <da********@noSpamhotmail.comschreef in bericht
news:OY**************@TK2MSFTNGP04.phx.gbl...
Try using a label instead of a hiddenfield control

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Jan" <cbcbc@xcvxwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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.DetailsViewInsertedEven tArgs) 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




Mar 8 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Sugapablo | last post by:
Let's say I create a new record in a table like this: mysql_query("INSERT INTO table (col1) VALUES ('example')",$conn); ....that had an auto-incrementing, unique identifying column named "ID"...
8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
5
by: yvan | last post by:
Approximately once a month, a client of ours sends us a bunch of comma-delimited text files which I have to clean up and then import into their MS SQL database. All last week, I was using a Cold...
9
by: Rich S. | last post by:
Hi In an earlier posting I was asking how to read thru millions of data records keeping the top 2000 (where the top values are based upon a field in the record) and niklasb suggested using a...
4
by: YFS DBA | last post by:
How do I use VBA to insert a *new* record into a subform? I have a master form with client information, and a sub form with billing information. I want to click on a button ("Add Data") and have...
2
by: M Fisher | last post by:
Is there a way to get the autonumber of a newly inserted record? I am working with unbound forms, and using an append query to insert a record into a table. I am then using a select query that...
6
JRBower
by: JRBower | last post by:
I'm experiencing an odd problem in which table records will not appear in a Visual Query Builder or in a datagrid UI unless certain dropdown data is inserted. For example I have two comboboxes...
2
by: TimSki | last post by:
Hi, In my asp page I am inserting a record in to the sql server 2005 db as follows... OpenDataConnection() oConn.BeginTrans set cm = CreateObject("ADODB.Command") set cm.ActiveConnection =...
0
by: fig000 | last post by:
Hi, I'm using an objectdatasource. The insert procedure called by the objectdatasource is in a separate library file outside of the aspx and the codebehind that is using the objectdatasource in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.