popups in asp.net - asp.net

i want to display the pop ups in asp.net page like how the stack over flow show the pop ups on the top of the site (you get the new answer for the question like that in a orange color) how can i write the code is there any free source code or any reference. thank you

Given below are the steps to achieve what you want.
Have a div (a container) to show your updates
Create a window.setTimeout to execute a JS function (AJAX)
In that function check for updates from server
Finally if there are any updates then show it in the div container
When there are updates then again setTimeout to make it invisible over a period of time (say 3 secs)
To achieve this in a very easy fashion use JS libraries like JQuery.
HTH

Thats not a 'popup', its probably just a standard DIV that has its height and content changed dynamically. You can do a "view source" on the page to locate the item, or use firebug (easier).
After looking, its a div called 'notify-container'.

These days, all that wizzery is generally done with jQuery

The asp.net ajax control toolkit has that. Check it out here.

I think you'll find that's done using a holding container at the top of the page, a timer to periodically query an AJAX enabled method for updates which replaces the content of the container based on the response.

Related

ActivityIndicator disable controls?

I want to have an ActivityIndicator that covers all controls, so the user cant click twice on the buttons. He have to wait for the loading to finish. For example, a login page in an app.
It could be something similar to this example on iOS http://developer.xamarin.com/recipes/ios/standard_controls/popovers/display_a_loading_message/
Thanks.
I'd recommend taking a look at Allan Ritchie's ACR Xamarin Forms library (available as a NuGet package). It has a Loading indicator that displays "above" the form and prevents clicking the underlying form elements.
I haven't tried this. But I might in a couple of days. But in the meantime I can give you my idea.
There is the absolute layout which you can make use of. Create a base page which is inherited by all your content pages and in the base page create the activity indicator with absolute position above. So all other controls falls under it. You can use the isbusy flag to notify property changes so that activity indicator is displayed and when the action is over set the flag to false and which in Turn will hide the activity indicator.
I had seen a sample somewhere which I will try digging up for reference. Probably in git.
For Reference

Telerik UI for ASP.NET AJAX window

I want to develop a web app where login form will appear in a RadWindow, which will slide from top and on close will go to top again. I have read many resouces but it's Animation property doesn't work like this. Do you have any experience with. What should I do? Please answer with some online example too. Thanks
Indeed, they do not work like that. So, it would be easiest if you animate the control's popup element yourself.
You can start with the FlyIn animation (it may be suitable for you, so you may not need to animate the appearance)
Then, you can use the OnClientBeforeClose event to animate the popup away yourself (there are many libraries that can do this for you and you can even use CSS animations), then hide it.
A similar approach is shown here http://www.telerik.com/support/kb/aspnet-ajax/window/details/close-radwindow-with-resize-animation-instead-of-fade

Controlling div visibility from toggle buttons on another page

I am looking to control the visibility of a div on one page from a toggle button on an admin page. I have seen many examples of this being done on the same page but none that explain what it would look like to have this done from another page.
There are a number of ways to handle this. You should research what you want to do and then decide on a method that works best for you.
Personally I would look at a server-side implementation. In this way you can control the output to the client. You can use session variables for example. How this is done will depend on what language you are using.
If you only want a javascript solution then I can think of two options. First is to use cookies. You can then read the cookie and show/hide the div based on the value. This is what I would do.
Second you can pass in a querystring parameter and read it on the other page. Then hide/show your div. http://mysite.com/?div=hidden
If the admin page opened the child page using JavaScript then you can assign the window to a variable and control the contents through that variable. Like so:
var childWindow = window.open('some URL', options);
// now toggle the div in the child
var childDiv= childWindow.document.getElementById('your_div_id');
$(childDiv).toggle();

Best option for modal screens in ASP.NET

I'm looking for the best way to implement a modal popup in ASP.NET of another ASP.NET page. I'm coding for Firefox 2.x+ and can use JQuery, but I'm not very familiar with it.
I see a lot of solutions that use "AJAX", but I'm not sure in what context, so I haven't gone down that route.
I'm using the jQuery UI Dialog plugin. Works very well. Documentation for the plugin can be found at http://docs.jquery.com/UI.
I have used both the ajax modal extender as well as the jQuery jqModal, both have worked pretty well. At the end of the day, this decision should come down to what the rest of the code is like, what your comfort is with each, etc.
If I were to pick an option today, I would probably pick the jqModal or simple modal for jQuery. I'm pretty comfortable with these now.
jqModal
SimpleModal
For simple modal displays, I've found BlockUI to be a great solution.
For example, here's a post about using BlockUI as a modal progress indicator, and here's one about using BlockUI to display a modal confirmation dialog.
If you need something more complex, I'd second the jQueryUI Dialog.
i've used AjaxControlToolkit but jQuery option suggested by #tvanfosson seems a lot nicer
You could use radWindow from Telerik, the jQuery UI Dialog plugin like tvanfosson recommended or you could take a look at
http://vision-media.ca/resources/jquery/jquery-popup-plugin-review which review some jQuery plugins for popups.
Having only expericence with radWindow, I can tell you that with radWindow, you might have to use some hacks and quirks to make it work properly, but the result is good if you put enough time into it.
I make my own, using DOM methods. I've found it to be a lot simpler than adapting any of these plugins to our CSS.
A modal is simply an absolutely positioned window with a background.
We make ours using a larger transparent container with floated contents.
I use a function that returns some html with the floated contents. The class used for the modal box should be absolutely positioned with a high z layer.
function create_modal(doc_id,css_class,append_to)
{
if(typeof append_to==='undefined'){append_to='content';}
var container=document.getElementById(append_to);
if(!container){return false;}
var modal_box=document.createElement('div');
container.appendChild(modal_box);
modal_box.id=doc_id;
modal_box.className=css_class;
return modal_box;
}
var modal_window=create_modal('modal_id','a_css_class');
if(!modal_window){return false;}
modal_window.innerHTML=function_or_var_providing_html();
so, it's all nice and simple without some 10 or 15 k plugin!

Open and Close Popup windows without Javascript in ASP.NET

How can I Open and Close Popup windows without Javascript in ASP.NET?
What do you mean "Popup windows".
JavaScript allows you to manipulate the properties of a window object allowing you to remove the status bar, address bar, set the size and position of the new window and other things.
The only other way (short of using VB script :) is to have links with target set to _blank.
But then you can't customise the new window.
You can't.
Opening and closing popups implies javascript code execution on the client side.
You could eventually create an ASP.Net panel that looks like a popup and set it visible/invisible during the postback but it won't behave like a 'real' popup.
Unless otherwise but I conquer with #Olivier that you can't do that without using Javascript. Even with the solution given by #Avi, you are still using Javascript though it is kinda abstracted from you.
Maybe, you could explain why you don't want to use javascript because even without the AjaxControl, it is kinda pretty easy to open and specify other properties of pop up windows.

Resources