-
Asp messagebox
i have some question to ask. Now i want to write the asp.net web application.
how do i popup the message box saying that "Are you sure you want to delete this record?" when the user click the delete button at the web form?
if yes then
delete code
else
delete canceld
end if
second question
how do i popup up the new windows. when the user click the see detail button. i just want to know the popup new ie page code only
thank
-
;) you need to do some JavaScript for this.
to open a new window you have to use:
window.open
to ask something from user use
confirm() function
-
-
Why can't you use MsgBox "BLAH" in the code behind module? I dont understand why they took that out.
-
Because the code behind file is only accessed when the page posts back and ran only on the server. The only thing that goes out to the client is html, which isn't that advanced. In your code, you could create a javascript and insert it into a page when it is sent back out to the client, but by then, the reason for the message box is usually past.
-
Re: Asp messagebox
I like the way it works but have you got code example of how you did it.
I need to do a similar thing when a button is pressed.
I want to run VB code, display a message based on the result of the code then run some more vb code based on the result of the message.
Any help would be appreciated.
-
Re: Asp messagebox
David - see my reply to your message on this for the solution...
Kev
-
Re: Asp messagebox
you can try adding javascript:
Private Sub dbGrid_ItemCreated(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
'-- record alternating highlights
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.SelectedItem Then
e.Item.Attributes.Add("onclick", "this.style.backgroundColor='beige';this.style.cursor='hand'")
'e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='white';")
End If
End Sub