Web Forms :: Close Page From Codebehind?
May 20, 2010
I have written this in my source page
<script type="text/javascript">
function CloseMe()
{
window.close();
}
</script>
and in code behind after clearing the sessions i have this
ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "CloseMe();", true);
The page is closing, but it gives a confirmation dialogbos saying do you really want to close this page Ok and Cancel. I don't want this confirmation box to come i just want the page to close how can i go about doing that.
View 4 Replies
Similar Messages:
Oct 27, 2010
Following is my requirement :
I have 3 asp.net web pages. From the 1st page i am opening showmoadlDialog(2nd page) in which(2nd page) i am storing some value in session(Ineed to do this here only) and checking some count which is coming from database, If count is Zero it will display message but if some value is there and then if i click on Ok button it will redirect to 3rd page. And close the 1st and 2nd Page.
how to do this ?
When i am clicking on Ok button it is showing some cofirmation message(Do you want to close this window) but this i dont want.
View 9 Replies
Apr 18, 2010
I have the default.aspx page that I'm using javascript (in page_load) to open a new window (main.aspx) without toolbars/menus. This is the window I wan't up the remainder of the time. Is there a way to close the default.aspx page after opening the new window?
View 6 Replies
Mar 26, 2010
How to close asp.net page without javascript ?
i want to close the page after c#.code
View 2 Replies
May 24, 2010
I have a button as bellow:
[Code]....
How can I close current page using C# at Code Behind?
View 5 Replies
Mar 27, 2011
I want to call a function (VB, server side function) when the page is close.
View 4 Replies
Feb 25, 2011
How can i Close page in my code on runtime
View 9 Replies
Nov 3, 2010
I am using asp.net to call the reporting services report. In my asp.net page, there is a parameter screen which while running opns the reporting services report in asp.net page as pageA.aspx Now, whenever, I again change the parameters on the parameter page and click the run button, if pageA.aspx is already opened, it just refreshes that page but the page doesn't generate new results ( caused by the change in parameters). I want to close that page (pageA.aspx) before generating the same page with other values (caused by the change in parameters in parameter page). I want this function in page_load() function of the param page.
View 6 Replies
Jun 12, 2010
I have a textbox that I need to make sure the case is right. I am using the code below but it is very slow, plus when I close my web page I get an error.
[Code]....
View 4 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
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
Jan 12, 2011
What is the earliest time that a control can be focused on without causing an exception/server error? It seems that newly-created (in codebehind) controls cannot be focused on until they're added to the page (or another container on the page), but I'd like to confirm and make sure.
View 2 Replies
Sep 13, 2010
I would like to create a webpage which can handle user events like page navigation and page close. And also I would like to handle the event on server-side coding.
View 1 Replies
Aug 25, 2010
I have a page with an iframe on it in which I load another page.On this iframe page I have some textboxes above eachother.When the first textbox is filled with a code the textchanged event is called nd the code is checked with the database.After the code has been changed to the right one (if needed) I want the focus to go to the next textbox.
So at the end of the event I do: Page.SetFocus(txtbox2)ut after the postback refresh, the focus is gone.
I have also put the control to be focused in a session variable and then in the page_load event I set the focus to the control in the session variable, but still no focus on the textbox.How can I put it on the 2nd textbox?all is done in the Iframe page codebehind.
I need this focus because the two textboxes are filled via bar code reader and after the scan an "enter press" is done automatically and to be able to allow two scans after each other this focus change is needed.
View 2 Replies
Jan 19, 2011
I am creating an ASP.NET website in Visual Studio 2010 (.NET 4.0) in C#.
I have a user control applicant_information.ascx which contains text boxes.
The page application.aspx contains this user control:
<%@ Register src="controls/applicant_information.ascx" tagname="applicant" tagprefix="uc1" %>
<uc1:applicant ID="applicant1" runat="server" />
The application.aspx page contains a multiview, and the applicant1 user control is in one of the views. The button continue takes the visitor to the next view which contains another user control of text boxes.
I want to write validation code on the continue_Click event which is in the application.aspx.cs page. Ideally, from the application.aspx.cs code behind page, I want to get the user input from a text box in applicant1.
Intellicense cannot seem to find any of the text boxes in applicant1 from application.aspx.cs.
View 3 Replies
Apr 17, 2010
I have a function that returns an image name from an Array, and takes the array index as a parameter, something as follows:
public string imageGallery(int imageNumber)
{
return "~\webForms\profileAdmin\uploadedImages\serkijn\" + iArray[imageNumber].ToString();
}
On the aspx page I have something like this:
<img src='<%# imageGallery(0) %>' />
[Code]...
View 3 Replies
Feb 14, 2011
I have a hiddenfield in my mater page declared as:
<asp:HiddenField id="hf1" runat="server" value="0" />
I have a Page_Load subroutine in my vb codebehind file that sets a value for hf1 as folows:
Dim hf1Ref as HiddenField = Master.FindControl("hf1")
hf1Ref.Value = "test"
In my pageLoad() Javascript file of my master page I simply try to do the following.
alert(hf1.value);
I get "0" for the hf1Value.
View 1 Replies
Feb 28, 2011
I have asp.net webpart page with close and minimize buttons for the webparts.
These buttons are disappering if page remains idle for 1 hour
View 3 Replies
Dec 16, 2010
I have website which runs multiple threads. When user close the browser but threads are still running. How to kill/stop all thread in asp.net on browser close.
View 2 Replies
Nov 23, 2010
Is there a way to show/hide (visible = true/false) a textbox and/or dropdownlist at PageLoad (or other Page cycle) from codebehind (I would like to check for some permission regarding current user and show/hide some controls from aspx page) ?
View 2 Replies
Aug 2, 2010
I have two datatables with datavalues
datatable A
ID data1 data2 data 3
datatable b
ID data4 data5 data6
I would like to merge datatable A and datatable B like so the resultset is like this in tableC
ID data1 data2 data3 data4 data5 data6
When my code finishes the column names are in this format but the data from dt b is pushed down into new rows instead of added on as new columns.
i used merge method but it giving like the bellow
example:
ID data1 data2 data3 data4 data5 data6
1 X X X
2
3
4
5
1 X X X
2 X X X
3
4
5
View 2 Replies
Jan 20, 2011
How would you call a Javascript Function from CodeBehind on Page Load event without : Ajax (ScriptManager), Response.Write ?
View 2 Replies
Sep 4, 2010
what I reakon should be a simple question for one of you code gurus out there.
ok here is my code VB snippet that I pasted from my web app, and if this is the wrong forum .
[code]....
View 2 Replies
Jan 12, 2011
I am not trying to activate an event or run a subroutine from a control from the masterpage, I am trying to activate or run from VB codebehind of the master page.
I have a button in a content page with a particular .click even that I want to activate from the masterpage codegehind periodically.
Also, how do I access or run a subroutine in a content page from codebehind in a master page.
View 7 Replies
Jan 19, 2011
I am putting a C# asp.net web form together that has a number of fields that we want to ensure data is inputted in them. I have added the RequiredFieldValidation control, but I am unsure what to put in the Button_Click event. I want the click event to check the fields and if not filled in, preserve the fields that already have data and then return the page data with the missing fields so that they user can take corrective action.
View 5 Replies