JQuery method for IFrame functionality - asp.net

I have a aspx page (details page) that needs to be loaded in a modal window on a click of a button. I have buttons in the aspx page that calls server side functionality. So, this is similar to an IFrame way (except that it's now in a modal window)
Is there a JQuery way of doing this? It appears that the JQuery load loads only fragments of HTML

You can put an IFRAME in a jQuery UI Dialog.

Related

how to show popup with user control when clicking a button in webform?

i want to create a popup window when clicking on a button in webform and after that i want to show a user control in that popup.how to do in asp.net?
i tried with some jquery methods but nothing happens when clicking button?
i want to create a popup window when clicking on a button in webform and after that i want to show a user control in that popup.how to do in asp.net?
i tried with some jquery methods but nothing happens when clicking button?
Think about using an IFrame to achieve this, from the sounds of what you are talking an IFrame would suffice and provided the needed functionality.
<iframe src="YOUR PAGE HERE"></iframe>
There's a lot more you can do with it, these are just the tags to get you going.

loading different pages in Iframe on button click, button is in main page

I have a back and next buttons and Iframe in main page.
On pressing next button next pages (which are forms to take input) are displayed in Iframe from server side.
I want to save data of current page in DB and then load 2nd page in Iframe. On clicking again save data of Page2 in DB and then load 3rd page in Iframe.
Similarly if user clicks back button he should get data of previous page.
Please suggest me how it can be achieved.
Thanks
To chane iframe src just use JS
function changeFrm(NewSrc){
document.getElementById('YOUR IFRAME ID').src=NewSrc;
};
And in your button add onClick="ChangeFrm('NEW SOURCE');"
Good luck!

Custom Popup Dialog Asp.Net

I'd like to create email dialog that has several inputs including message textbox plus some other custom info. I'd like it to display center screen over top of main page setting the opacity to like 50%.
do i create the pop up as anohter aspx page or panel?
Not sure what to use here, z-index, modalPopupExtender, Javascript, jquery. looking for easy and something stable.
I would look into the ModalPopupExtender in the AJAX Toolkit.
You can also try creating the dialog with jQuery. If you decide to go that route, check out the jQuery UI dialog:
http://jqueryui.com/demos/dialog/

Return value from modal dialog loaded page to parent page in .net using jQuery UI Dialog

I was trying to to create a pop up page using jQuery UI Dialog which will load another .net page in the modal dialog. I was wondering how to return values to parent page when a link button in gridview is clicked on the modal dialog?
If you can count on the page loaded in the modal dialog being served from the same domain as the parent page, then you can simply refer to a javascript function in the parent when a link is clicked like so:
$('.gridviewlink').click(function(){
parent.someFunc(infoToPass);
});
If you cannot count on that, then you will have to use cross domain iframe communication techniques. Here's a good article: http://softwareas.com/cross-domain-communication-with-iframes.

Is there a way to open another page using ModalPopup Extender?

I was wondering if there is way to open another page using a Modal Popup Extender?
and if there is can someone please the tell me how do i go about doing it ..
Thanx
Owais
You could probably put an iframe pointing to the page within the Modal Popup Extender, however that would be a bit of a hack. I would recommend putting whatever content on that page into a user control and then referencing that control from both the original page and the page with the modal popup.
Try using an HTML iframe as the target control of the extender. The iframe tag has a "src" attribute that should point to the page you want to show in the dialog.
You have to think about it w/o the illusion - fundamentally the modal popup is just a DIV. So the question is "can you display a different page in a div?". Iframe... or perhaps a webservice call.
you can use a user control and load it dynamically into the modal popup
Dim ctrl As Control
ctrl = Me.Page.LoadControl("~/control/cmsbar.ascx")
ctrl.id="ctrlx"
Placeholder1.Controls.Add(ctrl)
popup.Show()
note that the popup will have a placeholder to add the control to. you must give the user control an id so the viewstate can be loaded for the control . this code must be placed in the Page_Init event so when the user control is created for the second time it loads its view state

Resources