Javascript - .NET Cross Domain Modal Window (window.showModalDialog) - Parameter Value Always "undefined"?
Aug 27, 2010
I have two webpages, parent page .aspx and child page .html.
On parent page I have JavaScript function for invoking child page as modal window via window.showModalDialog.
function viewCourseModal(url) {
var sPars = SomeParameters();
var returnedValue = window.showModalDialog(url, "", sPars);[CODE]...
So when I launch parent window and invoke child modal window, parameter with "someValue" gets returned to the parent window (to modalReadyForTest control) upon clicking the button Button1.It works fine when I have both parent and child pages on the same domain. When I have them on different domains, value of the parameters does not get passed and instead it is always "undefined".Is there any way to have modal window from different domain returning parameter value to parent page? Can those cross domain issues be solved at all or should I try completely different approach?
View 1 Replies
Similar Messages:
Sep 24, 2010
I am using the javascript to open a child window using window.showModaldialog(), i have retuen a value from the child page is working fine in IE and firefox but is not working in chrome browser, is there any work around or alternative for it to work in chrome as well.
View 2 Replies
Feb 9, 2010
Whar are equivalent cross-browser solutions for window.showModalDialog? showModalDialog introduced in IE and FF 3.
View 4 Replies
Aug 24, 2010
I am opening a child window using window.showModalDialog() method. In the child page i have few server side controls whenever a postback happens the child page opens in a new window.
I have also set in my head tag,but it is not working.
<base target ="_self/>
For example
In Page 1: i have an anchor on whose click i open a child page(page2).
In my child page Page2: I have an asp.net button to search based on the criteria. when i enter the criteria and click search, the search results are show in new window rather then the same window.
similar to the post[URL]
View 2 Replies
Feb 2, 2011
I have two pages A.aspx and B.aspx Page A.aspx opens B.aspx as modal popup by javascript function window.showModalDialog("B.aspx"); Page B.aspx has two text boxes (Login, Password), <asp:Button> control and button click event in server code. Problem is when I click on the submit button it opens me B.aspx page in new third window How is it possible to not open new window on submit button.
View 3 Replies
Oct 18, 2010
i have an aspx page in which a link in the grid view opens a popup page . the data in the grid view would be dynamic and i need to send the id of the row of grid while calling the child window. i get the id using sender.id, but how would i send this using window .open()?
View 2 Replies
Feb 13, 2011
I have created 2 webpages call Default.aspx and Detail.Aspx. On Default.aspx, i had written a javascript to popup Detail.aspx through windows.ShowModalDialog.
Now how do i get reference to Default.aspx page within detail.aspx ? (like in Server.transfer function, i can just call this.Page.PreviousPage).
Reason for getting Page Reference rather than value reference, is, i can call all property and class within default.aspx.
View 5 Replies
Oct 14, 2010
I want open window.open as modal popup.
var features = 'resizable= yes; status= no; scroll= no; help= no; center= yes;
width=460;height=140;menubar=no;directories=no;location=no;modal=yes';
window.open(href, 'name', features, false);
I can use Window.ShowModelDialog(), but in my child window I am calling parent javascript method. That is not happening with ShowModelDialog().
function CallParentScript(weburl) {
alert(weburl);
if (weburl != null) {
var url = weburl;
window.opener.SelectUserImageCallback(url);
window.close();
return false;
}
}
If I use window.open(). I can call Parent javascript. But window is not modal. How to solve this? Can I write something in child popup to always top?
View 3 Replies
Feb 25, 2010
I have a modal pop up window (Ajaxcontroltoolkit one) and inside that I am trying to open a normal Java Script new window.
ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.UpdatePanel1.GetType(), "AnyScriptNameYouLike", "window.open('http://www.yourwebsite.com');", true);
But for some reason it does not open.
But it opens fine if I pu the same line of code in a button click event.
View 5 Replies
Jan 10, 2010
I am working on a ASP.NET website that needs popups in a modal window similar to JS confirm and alert. How would I do this on client and/or server side?
View 2 Replies
Feb 17, 2011
I have a need to display our application widget within a third-party website (think things like GetSatisfaction, UserVoice and other feedback widgets that people use). What is the safest and most reliable way to do this? I can think of some criteria and issues already: The code needs to be framework and language independent. Even though my app is ASP.NET, the 'launcher' will be run in any HTML page that belongs to our customers. So I suppose that limits me to HTML and Javascript only. The function needs to be very easy to call. So that implies a <script scr='mywebsite.com/widget.aspx' ...> as the sole thing to give to my customer. There is to be no use of CSS. Or rather, I can style things, but without a CSS file, as that could pull in styles that conflict with what my customer is running. There must be no use of libraries such as JQuery. I mention this because I can imagine problems if we pull in a JQuery version that differs from our customer's, thus ruining their site with our code.
View 1 Replies
Sep 30, 2010
I have a asp.net page that has a list of items. When one of the items from the list is clicked a details page is displayed. This details page has a link button to show a popup for history of the item. The details page also has a button with text 'Back'. The back button has onclick event set to "javascript:window.history.back();".
This back button works fine and goes back to the first page. However when the user is on the second page and opens the pop up by clicking on the link button, the back button stop working and displays Webpage has expired message.
View 2 Replies
Dec 3, 2010
I have the following HTML
<tr>
<td class="label" valign="top">
Affiliate Party
</td>
<td class="field">
<input type="hidden" name="ctl00$MainContent$ExternalAccountAttributes$AffiliatePartyId" id="AffiliatePartyId" />
<input name="ctl00$MainContent$ExternalAccountAttributes$AffiliatePartyName" type="text" id="AffiliatePartyName" class="PartyLookup" />
</td>
</tr>
and the following Javascript/jQuery
$(".PartyLookup").after("<img src='Images/book_open.png' class='PartyLookupToggle' style='padding-left:4px;' />");
$(".PartyLookupToggle").click(function () {
window.open("PartySearch.aspx", "PartySearch", "width=400,height=50");
return false;
});
I need to be able to flag ANY PartyId input field with class="PartyLookup" so that it will modify the DOM and include the image next to the input field. The popup window returns data to populate both the hidden and text fields, but since the click() is generic I need to pass it the ID of the input field.
View 2 Replies
Apr 4, 2011
lstItems.Attributes.Add("onclick", "javascript:window.location.href='" + Project2.Constants.MySiteURL + "myPage.aspx/" + ID + "';");
edit:-
i found this solution on SO but dont know how to use it in my case :
window.open("http://asdf.com", "window_name","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650");
edit 2 :-
Any Javascript expert in here ?
edit3 :-
@Headshota:: Its still opening in new tab in firefox and as apop up window in IE :(
edit 4 :-
@ Craig :: What does this mean? "possibly got a misplace target="_blank" somewhere" How do i check for it?
View 2 Replies
Sep 2, 2010
I've got a Jquery function that I wrote which blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time.
The environment is ASP.NET (VB). We don't technically use master pages, but we do have a parent page in which our header, footer and nav reside, and my Jquery code is called from that window, loaded via an IFrame.My problem is that if one is working in a child window, the parent window doesn't recognize that the system is in use, and will automatically engage at the allocated time.I've tried everything under the sun I can think of and nothing works properly. My event handler is working, and it does call the parent window function, but the timer is not being reset.
I have this function in the parent window:
<script language="javascript" type="text/javascript">
function window.reportChildActivity() {
SESSION_ALIVE = true; [code]....
View 1 Replies
Sep 23, 2010
we are running a click-to-call service, my idea is basically like this: website have a link on their page, when the link is clicked, a web page(say it is popup.aspx) hosted on our server is popup, user can input their phone number, and click "call me" button to let the website call him. In the button click event, I want to get Request.UrlReferrer, then query the db to get website's phone. But in IE, Request.UrlReferrer is null(firefox is ok, not test chrome yet),my question is how to get opening window' url in IE? we put popup.aspx on our server because
our client website is not force to use asp.net. we have the control what we put on the popup window, and can modify the page just from our side, if we put the pop window on our partner's side, if we have 100 partner, and we change the page's design, we will notify everyone of them to change this, change that. we can implement a statics system to know how popup a day, which site is most popular,etc
View 1 Replies
Mar 2, 2010
Value of window.XMLHttpRequest is Undefined when i run my application even in IE7 or IE8, Is there anything i have to enable in IE7 to make it work.
View 3 Replies
Sep 1, 2010
This is a followup question to the one here
Here's briefly what I am trying to do. The File server creates a text file to indicate an end of the process. On a webpage on the Web Server, I loop every x seconds and make an ajax request to find out if the test file exists (ajax request to [URL]
I've tried the following approaches so far:
Trigger a web method from the client side that creates a HttpContext object to verify if the text file exists. But this is too strenous on the server and I started getting all kinds of exceptions in the Event Viewer.
View 3 Replies
Sep 10, 2010
I have a link that is located inside a content control. This link calls a javascript function that opens a popup window containing a calendar and passes it the transformed id from the server of a textbox control using clientid. I need to be able to click on a date and have the popup close and insert the date into the textbox of the id I passed into the function which again, is located inside the content control.
This is the link in the content control:
[code]....
I should also mention the error I'm getting is:
window.opener.document.form1 is undefined
View 1 Replies
Feb 4, 2010
I have this polling script to check if a text file is created on the server. Works great locally, but fails when the file is on a different domain. How would i rewrite this for cross domain support?
$.ajax({
url: 'http://blah.mydomain.com/test.txt',
type: "GET",
success: function(result) {
//Success!
window.location.replace(Successful.aspx');
},
error: function(request, status, error) {
setTimeout("VerifyStatus(" + pollingInterval + ")");
}
});
EDIT: I ended up using YQL to solve the cross domain issue and although it works, YQL is really slow that's adding quite a bit of performance overhead. Can anyone suggest a better solution for cross domain JQuery calls?
View 3 Replies
Mar 12, 2014
I happen to need this modal window to appear in height and width to be as large as a standard webform... I placed settings in the showdialog function for specific height and widths and nothing happened it maintained the size of a small dialog window with scroll bars vertical ones.
so far this is my javascript code behind the c#
Code:
<script type="text/javascript">
var childwindow ;
function ShowDialog() {
childwindow = window.showModalDialog("CriticalIncidentReport.aspx", 'center: yes;resizable: yes ;status:0;state:maximize');
}
</script>
This is the c# code behind the button click event
Code:
protected void myBtn_Click(Object sender,
EventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "JScript", "ShowDialog();", true);
}
View 3 Replies
Jan 5, 2010
I have written code to access a text file in another server from my application in javascript. This code works fine in IE but fails in mozilla firefox. Below is the code i have written.
var httpRequest;
httpRequest = new XMLHttpRequest();
httpRequest.open('GET', url, true);
httpRequest.setRequestHeader('X-PINGOTHER','pingpong');
httpRequest.setRequestHeader('Content-Type','application/plain');
httpRequest.onreadystatechange = function() {alertContents(httpRequest);
httpRequest.send('');
function alertContents(httpRequest){
if (httpRequest.readystate == 4){
if (httpRequest.status == 200) {
alert(httpRequest.responseText);
}
}
}
View 2 Replies
Aug 24, 2010
I have a webpart in a page in which there is a gridview(which shows list of customers). When I click on a link button in gridview, I would like to popup a JQuery modal window and fill the popup(this contains textboxes, then a gridview which contains mapped systems for thet customer, and another gridview which contains list of configured reports for that customer) with the details based on the customer name(link) clicked. Here I need to pass the customer Id and customer name parameters based on which I can fill the Jquery modal window.
pass parameters to JQuery modal window in order to fill the contents inside it?
View 1 Replies
Jan 25, 2011
I want to know, if its possible to pass collection between pages. I mean to say i have a client-side JavaScript modal dialog on which I want to use my collection. Earlier I was using Session[] to share the value, but its becoming evil for me, as it always displays the first value. Any change in value in not updated.
So whenever my pop up is displayed I want the collection to get moved to the Child dialog. From there, i will extract the Collection, do some stuffs and again return it to parent page, preventing postbacks and session management.
View 1 Replies
Feb 24, 2010
On a list page, clicking on one of the items brings up the details in a modal popup window which will have its own functionality (like validation, updating etc). What's the best practice to implement this (not looking for a hack). I see two options here:
Hide the details markup until a list item is clicked at which time, do a ajax request to get the details and populate and show the details section. Have the details section as a separate page by itself. On a list item click, show this page in a modal window (is this even possible?)
View 1 Replies