Results 1 to 4 of 4

Thread: Run Popup without Button

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    6

    Run Popup without Button

    Hi,
    I want to open a Popup if a query result isn't valid.

    It's an aspx where you can put data into a db.
    When you hit the insert button it checks if there is already an entry with the same name.
    If it's so, there should come up the popup with a text.
    If there is no entry, it puts the data into the db.

    For the popup I'm using javascript.

    Now the problem: I know how to open the popup with a buttonclick event.
    But how can I open the popup without a buttonclick??

    Is Ajax the better way to build a popup?

    Thanks!
    Last edited by Threewood; Jan 12th, 2011 at 06:02 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Run Popup without Button

    Moved To ASP.NET

  3. #3
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: Run Popup without Button

    You add the alert javascript to the page from your codebehind using RegisterStartUpScript

    However Javascript alerts aren't exactly nice to look at or user friendly as you have to click a button to get rid of it, so I'd definitely consider using something else such as updating a label with your message.

    EDIT: Sorry I assumed by pop-up you meant a javascript alert but that might not be the case. If you mean opening another browser window I would definitely recommend using something else as a lot of users would find that more annoying than a javascript alert..

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Run Popup without Button

    Hey,

    I think it would help if you were to show us the code that you are using.

    I have to agree with FishCake on JavaScript alerts.

    Are you actually doing a PostBack to the server when you want the "popup" to appear? Something has to initiate the "popup".

    Gary

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