Web Forms :: Cannot Close The Window In Mozilla And Chrome Gives Scripting Error
Jan 24, 2016
Please click <a onclick="self.close();" href="#">here</a> to close this window. this is my code .
when i submit in chrome and mozilla it shows the error.
" script must not be allowed to close a window that was not opened by that same script."
I tried with
function quitBox(cmd) {
if (cmd=='quit') {
open(location, '_self').close();
}
return false;
}
but it does not work for me
window.open('', '_parent', '');
window.close();
and also with this script.
how i close the tab on clicking the close tab.
View 1 Replies
Similar Messages:
Mar 28, 2011
I am using javascript based calendar control in my application.
Following is my .aspx and .aspx.cs file.:
.aspx file:
[Code]....
.aspx.cs:
[Code]....
On click of hyperlink we are opening javascript calendar and assiging it to textbox.
The same functionality is working in IE, but its not working in Mozilla firefox and Google chrome.
This is one of the major problem i am facing in entire application.
I want to make my application to be work fine on multiple browser.
View 1 Replies
Mar 10, 2011
I have a login page that is loaded in popup window (colorbox) and after user logs in it should be closed and parent window should be loaded with new page.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Do While reader.Read()
If Trim(reader("ZAP").ToString()) = Trim(textBoxZap.Text) Then
Session("A") = "1"
Response.Redirect("~/default.aspx")
Else
lblErr.Text = "incorect"
End If
Loop
So once the buton is clicked and user name and password is corect popup window should be closed and user redirected to default aspx.
View 1 Replies
May 14, 2010
I have created an intranet application in ASP. From my main web page I am opening a web browser window and adding a record to database from that new window. Now on close of that window I want to refresh my main web page to reflect the database changes. My backend is "ms access" Also on the other hand I also want to disable the closing button of web browser.
View 2 Replies
Jun 29, 2010
I have created a we app. using win authentication. When type the server ip addres in chrome I get the login window and it works just fine with my organizations credentials, however when doing the same using Internet Explorer I have to login with the server credentials as my account is not valid.
View 1 Replies
Apr 27, 2016
I am having an issue with images not showing in Chrome or FireFox. In chrome i get this message in the Console "Not allowed to load local resource.". The images appear fine and correct in IE11 & MS Edge. I'm assuming this is some king of security problem I need to address, but am not at all sure what.
I have posted the code behind and Mark Up below.
// Code Behind
string imgPath = Server.MapPath("/images/");
List<FileInfo> images = new List<FileInfo>();
[Code].....
View 1 Replies
May 20, 2010
Refresh the Parent Window. I open the child window,I want that on close button click on child window,parent window refreshes
Code:
[code]....
I searched all on the net & find the above soln,But its not refreshing.when i click on button1,then some Pop up appears see in Pic(with buttons Retry & Cancel). When i click on Retry again the child window loads Then again i click on button1,again popup appears & so on & on.
View 10 Replies
Dec 20, 2010
We are using Web Part Zones to display certain Charts in our website. In the title of the Zone, we are using the below code to display the menu for Minimize, Refresh and Close buttons.
<CloseVerb ImageUrl="~/Images/Close.png" />
<MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
<TitleBarVerbStyle CssClass="WPVerbBar" />[code]....
This buttons are working fine in IE and in Firefox. But the same is not working in Chorme and in Safari.We got the below script error in Chrome:
Uncaught TypeError: Object #<an HTMLElement> has no method 'attachEvent'
ScriptResource.axd?d=JgYxHqt6li1Lc12at8VRK-y-qeXK_5Wiei-tKNUi8rRE-1X5EEl-KvYEuW4m8Foj1VyIiaN7sK98_-pMwa5y7w2&t=633802855995006876:277Uncaught TypeError: Object #<an HTMLElement> has no method 'attachEvent'
View 1 Replies
Jan 25, 2013
I have textbox in my page that I put this attribute for it TextMode="MultiLine"..here user can change width and hight of textbox with mouse..I couldn't find any attribute for textbox that din't allow users to change width and hight of textbox.
View 1 Replies
Mar 5, 2010
I have all of my code into one ASPX file. Called Scheduler.aspx. I am using the DayPilot scheduler and the Obout Flyout. But i moved it all to one page to make it simpler. But one thing I am having probelms with is; when I save my popup it should close and refresh the page. And when I hit the close link it should close (which it does) and then refresh the popup when I click on it to open again (which it doesnt). Since I have this all on one form and I am calling the popup using the flyout I can't figure out how to do these.
My page is called: Scheduler.aspx
My Scheduler is called: dps
My flyout is called: EventFlyout
Right now I have the flyout opening from a label. So when I click on the label my flyout opens, I insert data and it saves to the database. But i have to close my browser and open another to get the data I just imputed to show.
View 9 Replies
Oct 31, 2010
I have a page that has a note to the user about the file they're about to download and a button to click to start the download. When they click the button, it does a Response.Redirect to another page with the following code in its Page_Load:
Response.Clear()
Response.Buffer = True
Response.AppendHeader("Content-disposition", "attachment; filename=" & FileName)
Response.AppendHeader("Content-length", FileSize.ToString)
Response.ContentType = "application/download"
Response.WriteFile(Page.ResolveUrl(FilePath))
Response.Flush()
Response.End()
I want the download to start and then I want this page (which is a tab in the browser) to close.
The code to download the file works fine. I just can't figure out how to close this tab when it's finished. I've read a lot of forum posts from people who are using similar code, but none of the suggestions seem to work for me. I understand that Response.End means that I can't put any more code this page; it will be ignored. But how do I get this tab to close?
View 4 Replies
Feb 8, 2010
I produce a popup window by adding a hyperlink to a table cell dynamically in my vb.net code behind. Here is the code:
Dim sHyperlink As
String =
"<a href=""LabPopup.aspx?RefNo=" & iLabRefNo &
""" target=""_blank"">" & strValue &
"</a>" objCellValue.Controls.Add(New LiteralControl(sHyperlink))
So on my web page, I will have a list of these hyperlinks and each have a different iLabRefNo. When I click on one of these links, the popup window does appear correctly.
I have a button on the popup window that closes the popup. But I get this message in an alert box when click on my button:
The webpage you are viewing is trying to close the window. Do you want to close the window?
If I click OK then the window close. But I just want to close the popup wondow without this message. What do I need to do?
Here is my code for the button to close the popup:
<asp:Button
ID="cmdLabPopupClose"
runat="server"
Text="Close"
OnClientClick="CloseWindow()"
/>
<script type="text/javascript">
function CloseWindow() {
window.close();
}
</script>
View 11 Replies
Aug 15, 2010
On successfull update a popup is appearing that "Data updated Successfully." with the Ok button. I used following piece of code:
Page.ClientScript.RegisterStartupScript(Me.GetType(),
"MyScript",
"alert('Record Updated successfully.!');",
True)
REQUIRED:
I want if user click OK button then window should also close.
View 10 Replies
Jan 20, 2011
I create a page index.aspx and another inserir.aspx
The index is the master and the inserir.aspx is the popup... The popup is a insert form and works fine but, when it inserts I want to close the window and return to index.aspx...
[code]....
View 9 Replies
Mar 15, 2010
I inherited a poorly designed ASP.Net web site. Here are some of the main parts;
1. Default.aspx. This web page conatins several user controls that do the bulk of the work.
2. Alerts.ascx. Used by Default.aspx
3. Dashboard.ascx. Used by Default.aspx.
4. LabResults.aspx. Popup window called from Alerts.ascx
bear with me while I describe the scenario:
1. The user clicks a button on default.aspx and a page in Alerts.ascx is displayed. This works fine.
2. The user then clicks a hyperlink control on Alerts.ascx and the popup window LabResults.aspx displays. This also works fine.
3. The user clicks a button on the popup window. Here is where I am having problems. I want to close the popup window and do a post back but not to Alerts.ascx. i want to instead call dashboard.ascx and run a particular event which displays some patient info. I do not know how to pass control to the dashboard.ascx user control at his point. Presently, my popup window closes which is good but the Alerts.ascx page is still displayed. I want to close this page and open the dashboard.ascx instead.
View 12 Replies
Mar 26, 2010
The program is written using dotnetnuke and c#
Im facing the following problem. I have a aspx page (test.aspx) where I have a form what I want to do is when I hit a button on the test.aspx I open another window (getCoordinates.aspx)where I do some things and create some session variables.
When I close the getCoordinates.aspx I want to call the page load of the test.aspx so I can make use of the session variables I created and fill some textboxes
How can you refresh the 'parent' page when you close a 'child' window
View 10 Replies
Jan 5, 2011
I open a popup window by client code. Now I want to do some calculation on this popup window & if it success then I want to save the calculation result in a session variable and close the window. I mean I want to click a button on popup window, it will do some calculation on server side and if it success the it will store the calculation result in a session variable and close the popup window.
View 6 Replies
Nov 3, 2010
I have a main page, when i click a button, appear another window. When i close the another window, i wanna make one loop for fill my fields in the main page. How i can do that? Activate some event or something like that?
View 2 Replies
Oct 26, 2012
How to call the server side method on browser window close button...
View 1 Replies
Oct 7, 2010
xml parsing error no element found location line number 1 column 1. If run every application this error come (in mozilla only). how to rectify this error.
View 1 Replies
Sep 3, 2010
I am using this code.This pop up window pops up when I clicks a button on the main page.Now I want the pop up window to be closed if the password is successfully changed and reload the main page,but if the password is not changed then refresh the pop up window again.
Here is the code.
<asp:Textbox id="curnt_paswrd" textmode="Password" runat="server" />
View 1 Replies
Mar 16, 2010
We have a GUI which runs on ASP.NET 2.0 framework (Client-Server model). From the support perspective how can one find whether the pages which are opening on GUI at any point of time is a server side scripting or Client side scripting.
The reason why I ask this is because I understand that some of the codes are executed by the browser such as Javascript. So, if there are such scripts which are handled by the client browser, how can one find out that it is the Client side scripting which is running at that moment.
View 1 Replies
Oct 14, 2010
I have asp.net button "OK" in html popup window. I after my logic done how close that popup window it self?
<asp:Button Id="btnOK" runat="server" AccessKey="<%$Resources:
wss,multipages_okbutton_accesskey%>" Width="70px" Text="<%$Resources:wss,
multipages_okbutton_text%>" OnClick="btnOK_Click" />
View 5 Replies
Jan 10, 2011
< asp:ModalPopupExtender
ID="popupctrl"
runat="server"
TargetControlID="popup2"
PopupControlID="popupcontent" >
</asp:ModalPopupExtender>
this is my popup window code.. how can i include close(*) icon and make it work??
View 3 Replies
Nov 29, 2011
I have one webform and two popups. I am opening 1st popup using window.open method from my webform and it is working fine. then i am opening 2nd popup as showmadaldialog from 1st popup.
my second dialog have one button and if i click the button my two popup's(one popup and one dialog) should be closed and my webform should be appear.
currently am able to close 2nd popup. but am unable to close 1st popup from second popup.
[note : two popups are modal dialog] ....
View 1 Replies