|
-
Jan 12th, 2011, 05:49 AM
#1
Thread Starter
New Member
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.
-
Jan 12th, 2011, 07:31 AM
#2
Re: Run Popup without Button
-
Jan 12th, 2011, 12:02 PM
#3
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..
-
Jan 12th, 2011, 09:47 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|