C# - Capture Tabpage Close Event
Dec 23, 2010i'm using this control [URL] the one with the close red X ( like chrome ) on every tabs.
I need in my project to capture if a tab is close by the red X.. How can I do it?
i'm using this control [URL] the one with the close red X ( like chrome ) on every tabs.
I need in my project to capture if a tab is close by the red X.. How can I do it?
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 Repliesi am currently developing an asp.net project. there is a previous, next, and cancel button that the user can utilize, but the problem is that everything is broken into controls so that if they hit the browser's back button it will reset everything and take them to the very beginning. i would like to capture the onbeforeunload event and trigger the previous button click event (i.e. treating navigation like clicking the previous button).
View 6 RepliesUsing vb.net/asp.net 2005.
I have a page books.aspx that has a control named authors.ascx.
Inside the authors control there is a "select" button I want to add some kind of listener or event handler (not sure of the correct terminology) so on the parent page (books.aspx) I can respond to the "select" button being clicked.
I have to pass the authorID from the user control to the parent page.
In my authors.ascx control I just created this event:
[Code]....
Now I need to write the function for SelectAuthorBtnClick and I think add some kind of listener in the parent page to listen and handle the event.
How to call button event on browser close event? is it possible?
i have a button placed on my master page and when user try to close the browser window, i want to invoke this button event placed on my master page...
As you can see in the image below there is a ValidationSummery exists inside a TabPanel.In spite of I haven't changed anything in the default style template which added by the Visual Studio. the validation summery's font is a bit big although its size is normal when it is not in the TabPanel.And the TabPanel doesn't have any style and all the controls which inside it appear in their default size.I wonder if you could help me with any idea about this strange size.
<ajax:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<ajax:TabPanel ID="BasicInfoTab" runat="server"
HeaderText="<%$ Resources:Resource, tabBasicInfo %>">
[code]...
I have a ListView that has a Button in the item template. Is there a way for me to identify which Item had it's button clicked from my OnClick event?
I was able to do it with the code below but it seemed crufty. Is there a better way to do this?
((ListViewDataItem)((Button)sender).Parent.Parent)
UPDATE: Was able to implement using the NamingContainer method that one user suggested and then mysteriously removed his answer. Seems like a safer way to do than my original method:
((ListViewDataItem)((Button)sender).NamingContainer)
In my gridview when the tab button is pressed the RowDataBound event is fired and I can capture the tab event. But if there is no data in the gridview textbox and tab is pressed, the RowDataBound event is not triggered. Is there a way to capture that event?
View 1 RepliesDuring pageload i would like capture, which event is raised and its ID .e.g button click event , textbox value change event. I have tried by using the below code in page load but always iam getting only balnk value.
Dim lsTarget As String
lsTarget = Request.Form("__EVENTTARGET").ToString
lsTarget = Request.Form("__EVENTARGS")
I am using asp.net treeview control. when ever user clicks any node,i want to perfrom some operations.
currently i am using the OnSelectedNodeChanged event.
but if user clicks on the same node which is already selected then OnSelectedNodeChanged is not getting called ( obviously it wont).
but i want to handle this case also. i want to do some tasks in server side even if he clicks on already selected node.
I need to capture the 'Update' click event with jQuery in an asp.net GridView and have no way of knowing where to start. I'm still rather new to jQuery. My GridView is attached to a SQLDataSource and, naturally, has all the bells and whistles that that combination affords.
View 5 RepliesI have a custom hierarchical data source based on the msdn example [URL] An event can be raised in the DataSourceView. If that occurs, I want to display a message on the web page.
The example is that I have a page with a TreeView control which uses a custom hierarchical datasource. If the user selects a node that they are not allowed to select, the underlying datasource will throw and error.
I want to capture this and add a message to the page. The Page_Error event is raised, but there are no eventargs.
Anybody know how to capture such an event?
An alternative approach, although not quite specific enough, is to set a flag during the datasource load event (indicating the datasource is loading) and test for this flag in the Page_Error routine.
I have the following download request in javascript:
var exportWindow = window.open('Download.ashx?source=1', '');
exportWindow.onload = function() {
alert('finished');
};
My problem is that the above alert box does not appear. The download.ashx sets up the following response (which will be saved as a csv file), which works fine.
context.Response.ClearContent();
context.Response.ContentType = "application/text";
context.Response.AddHeader("content-disposition", "attachment; filename="" + fileName + """);
context.Response.Write(resultWriter.ToString());
context.Response.Flush();
context.Response.Close();
If I replace the download.ashx with a normal aspx page, then the alert appears. So my question would be: is it possible to know programatically when the dowload.ashx returned with a response?(using FF3)
I knwo how to capture a line number from en exception error...but I have a need to capture the line number that certain things occur wihtout having excpetion thrown. I guess one way would be to force an exception to occur and then trap the line number but I dont really want to do that because that seems clumsy to me.
What woudl be nice is if there were some way to just say "what line of code is this?" programmatically.
so that regarldess of any code changes when I need that information to be grabbed it alwasy grabs the right value.
I want to call a function in my Global.asax when the user closes his browser so I can delete a databse entry but how do I have to do this?
View 7 RepliesI have a text box with an associated popupcontrolextender.This opens a panel containing a checkboxlist. What i want to do is add the values selected in the checkbox list to the text box when the user clicks out of the panel.I started to use the OnselectedIndexChanged, of the checkboxlist and update the text box after every checkbox has been checked / unchecked.But the checkboxlist is quite long and when you click one of the checkboxes near the bottom,because everything is in an update panel,the checkboxlist scrolls to the top after the autopostback not very user-friendly.
I need to achieve an effect of a read-only textbox, where when the user clicks on the textbox a popup grid control appears, after the user has made a row selection the text box is populated.... Looking at the AJAX Toolkit model it seems like a CustomExtender would be the way to go, but I can find no documentation on how to build such a thing, so I am looking at improvising.
Here is my process (which is still not working):
Using either an ASP.NET TextBox or HTML <input type="text" runat="server"> control I need to able to trap on the onclick event and then set an ASP.NET Panel control Visible="true". I have tried placing my GridView control inside a <div> and using style properties to set it to hidden and using a client-side (javascript) event handler on <input type="text"> onclick event setting the style property to visible, this does not work correctly. It results in a empty place-holder like grid that popualtes on click (I suspect this is because the DataGridView lives inside a ASP.NET Panel)
I would like to be able to call a server-side method from inside my client-side JavaScript function. I seem to recall from Microsoft AJAX 1.0 docs a way to RegisterClientScript or some approach that allows this and can not find anything on this being supported with the ControlToolkit/MS AJAX 2. If I can do this I could set my ASP.NET Panel Visible property to true and then call Update() on it's UpdatePanel parent which should give me exactly what I'm looking for.
I have a form that contains a TextBox. A pop up window will return a value and put it into the TextBox. when this happens, i need to populate another control. I tried "OnChange" but it was not triggered .
View 1 RepliesHow can i capture Application pool recycle event in asp.net c# code so that when recycle event occurs i can make a post back or refresh the page in the code ?. Our Application sessionstate mode is StateServer which helps me in not loosing the session data but still i need to refresh the page at server side only on this particluar event.The reason is at the client side javascript webform_DoCallBack doesnot fire when there is application pool recycle and thus website stops getting updates.we have a timer set to 15 minutes when webform_DoCallBack fires and fecthes updates for the page and displays it.
View 8 RepliesI'm looking for an event like onclose when the PopupControlExtender closes itself when a user clicks outside the popup.
View 4 RepliesI am trying to capture the SelectedIndexChanged event for a drop down list I have put inside of a gridview control. It posts back fine, but does not go into my SelectedIndexChanged event handler. Here is my code
[Code]....
it is still not going into my myddl_SelectedIndexChanged() eventhandler.
I am developing a web site to display some data that is inside a database. To do this I've created an ASPX web page that opens a connection to a database and retrieves the desired data. After that it populates an asp:table object dynamically.
The problem is that some of the fields that are retrieved from the database are too large to be displayed on the web page, so I decided to make a popup that would be able to display just the desired field.
To do this I've added a button to the asp:table so that when the user clicks it the popup would appear with the contents of the field. However what is happening is that when the user clicks on the button, the page just gets reloaded and the Click event handler is never called.
Below is the code in which I add the button to a TableCell, and the TableCell to the TableRow collection:
[Code]....
note that the popupHandler is a delegate to the function below. I am using it as a the Click event handler for testing purposes.
[Code]....
Also you should be aware that the table is only populated when the user clicks on a "Query" button inside the main ASPX web page, this means that I only populate the table after the PageLoad event has occurred.
In our application we need to handle browser close event. When a user directly closes the browser, we should give him an alert message and stop him by directly closing the window based on some conditions. This we have handled through body onunload event. The problem is we are getting the alert message but after showing the alert message the window gets closed.
Is there any way to stop closing the window on click of browser close event?
And also when the page is refreshed, the last performed action is getting fired again.
I have a gridview that receives data based on selection from a primary dropdownlist object. Works.
Within the gridview, there is a dropdownlist whose selected index is based on the query from the primary dropdownlist. Works.
Problem.
How do I force the used to change whatever value that the dropdownlist contains after they make their initial selection from the primary dropdownlist; except the default value of "make a selection".
Gridview, contains a checkbox which drives whether a selected row is inserted into the data base. The databind in done using an ObjectDataSource on the presentation page, not in the code behind.
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