473,385 Members | 1,782 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,385 software developers and data experts.

help needed with popup window

I am trying to use the server side code to have a popup window come up only
under a certain condition.

For example, the user presses a button to retrieve a set of records. So

- If there are records to be retrieved, then display the records in a
datagrid
- If there aren't any, then show in the pop up window that there aren't any
to display.

The problem with setting the "OnClick" attribute of the button to the alert
java script is that, I cannot make it conditional. It will launch the pop
up window no matter what.


Nov 18 '05 #1
1 1081
David Cho wrote:
The problem with setting the "OnClick" attribute of the button to the
alert java script is that, I cannot make it conditional. It will
launch the pop up window no matter what.


Hello David,

As you said, you're trying to use _server_side_code_ to get a popup
window to come up only under a certain condition, so the "OnClick"
attribute of the button is not the right place to look.
This attribute is for setting the _client_side_ event handler.

A way to achieve what you want is to put some code in the
server side handler for the button Click event, that checks
whether there are records and if there aren't any,
dynamically add a LiteralControl, containing the JavaScript
that pops up the window, to the Page's Control collection.

Best regards,

Eric


Nov 18 '05 #2

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

Similar topics

2
by: Xenophobe | last post by:
I have a popup window (required by the client) containing a form and would like to prevent users from accessing it directly. They are instead required to access the page via a hyperlink on another...
2
by: Targa | last post by:
Im using the code below to pop up a window: It works fine except for that in the titlebar, my domain name is listed before the page title like below: http://mydomain.com - MyPopupwindowname -...
1
by: Medical Watch | last post by:
Can anyone help me on this: I want to be able to open my paypal "view shopping cart" window with. window.open(url, cartid,window attrb) but it gets blocked by the popup blockers. window size is...
1
by: MSDN Account | last post by:
We have web site that used the IIS ResKit tool MSWC.PermissionChecker to check file permissions. The web site has been upgraded and that upgrade included changing the default server side language...
3
by: Chris | last post by:
Hi, I have a parent page that loads a popup and when the OK button is press it pass the value back to the parent form textbox. It passes the value but it doesn't close the popup but also open...
4
by: Chris | last post by:
Hi, I am trying to create a popup calender so a user can click on a button on the main form, a calender will then popup, the user will select a date and then click ok on the popup. The date will...
5
by: Chris | last post by:
Hi, I have been trying for days, yes days, to use the calender from the asp.net timetracker starter kit. I am now frustrated. I finally get the popup calender to popup but when I click ok to...
5
by: W.Sh | last post by:
Hello Everyone! I'm having some issues with javascript that I can't seem to resolve... Basically, I have a very simple code that's supposed to change the innerHTML of a span element whenever I...
3
by: johnsonholding | last post by:
Here is the script I have in my page : <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "',...
5
nirmalsingh
by: nirmalsingh | last post by:
hi all, i want to pass a value from one php file to another popup window the value i am having is (in sample.php) $value="<p><em><font style='background-color: #ccffff' face='Comic Sans MS'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.