How to display a non ajax popup
How can i get a popup on homepage like groupon or Yellowpage does. Those are not ajax ones, if i am correct. I am wondering how is it possible to display popups with good images in Asp.net website?
I have used ajax ones开发者_StackOverflow社区 before without image!
Use jQuery UI Dialog.
I believe you have some misunderstanding in the concept. AJAX, by definition, is when your web application sends data to, and retrieves data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. You may need AJAX to perform a server operation (like submitting data to the server) or update certain portion of your page smoothly without letting the user feel the flickering (and this MAY include showing a popup).
To answer your question, you need to utilize javascript, HTML, and CSS to accomplish your goal, or else you may use a ready-made library for that, in which I strongly recommend jQuery UI. Check their website for the Dialog extension:
jQuery UI Website
To open a popup in JavaScript, you can use the following:
openChildWindowWithDimensions = function(url, width, height, showMenu, canResize, showScrollbars) {
var childWindow = window.open(url, "", "\"width=" + width + ",height=" + height + ",menubar=" + (showMenu ? "1" : "0") + ",scrollbars=" + (showScrollbars ? "1" : "0") + ",resizable=" + (canResize ? "1" : "0") + "\"");
if (childWindow){
childWindow.resizeTo(width, height);
}
}
精彩评论