How To Use Pop Up Control In Asp.Net Using Ajax
In this tutorial we will learn how to use pop up control in asp.net by using ajax controls. I have mentioned all the steps for using pop up control in asp.net, you can easily understan how to use these controls by following these simple steps. So lets starts.
Some Important Points :: |
Make sure that you have installed Ajax Toolkit into your Toolbox. If not you can download Ajax Toolkit from this link Download Ajax Controls Toolkit and install it to your toolbox.
For installing Ajax Toolkit see this tutorial ::
How To Install Ajax Control Toolkit in Visual Studio.
Way to use Pop Up Control :: |
Step 1 ::
The very first step is to take a Script Manager or a Tool Script Manager
Goto Tool Box > Ajax Control Toolkit Tab > ToolScriptManager
Step 2 ::
After taking the ToolScriptManager take a panel from standard tools tab
Goto Toolbox > Standard Tools > Panel
Step 3 ::
Now take a table into the panel and write some text ("Hello this is popup example") and take two buttons inside the panel' table and change their name as OK and Cancel buttons.
Goto Toolbox > Standard Tools > Button
Step 3 ::
Now take a third Button outside the Panel and change its text and id according to you. Make sure it is outside the panel.
Goto Toolbox > Standard Tools > Button
Step 4 ::
Now goto the smart menu of third button in my case Show Popup button and click on the ad extender link you will see a popup window will open. Select Modal Popup Extender from that window and click on OK button.
Step 4 ::
After adding the extender to the third button go to the properties of third button, here you can find a tab ShowButton_ModalPopupExtender(in my case) explore that tab. In this there are mainle three main things-
- PopupControlID - put the id of your Panel
- OkControlID - put the id of OKButton
- CancelControlID - put the id of CancelButon
after that close the property tab.
Step 5 ::
Now generate the click event of "Show Popup Button"(in my case) just simply double click on that button
and a single line code.
{ShowButton_ModalPopupExtender.Show();
}
and you have to write a single line code on to the Page Load Event also
{
ShowButton_ModalPopupExtender.Hide();
}
now save all the things.
Step 6 ::
now goto .aspx page and take a view pf that page into tha browser..
when it opened in browser click on Show Popup button and a pop will open..
Thank you fof giving you time. If you have any problem in this comment it..
How To Use Pop Up Control In Asp.Net Using Ajax
Reviewed by Team tt24
on
12:00 AM
Rating:
No comments: