Results 1 to 8 of 8

Thread: Asp messagebox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2002
    Posts
    22

    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

  2. #2
    Junior Member
    Join Date
    Mar 2003
    Posts
    16
    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
    vijay pahuja
    mumbai

  3. #3

  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Why can't you use MsgBox "BLAH" in the code behind module? I dont understand why they took that out.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    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.

  6. #6
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    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.

  7. #7
    New Member
    Join Date
    Jul 2004
    Location
    Lansing, MI
    Posts
    11

    Re: Asp messagebox

    David - see my reply to your message on this for the solution...

    Kev

  8. #8
    Fanatic Member VBKNIGHT's Avatar
    Join Date
    Oct 2000
    Location
    Port25
    Posts
    619

    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

    If a post has helped you then Please Rate it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width