FAQ: Sequence that events are raised for Pages, UserControls
ASP.NET Page Life Cycle Overview (and quick sheet)
and my old post Event sequence for ASP.NET user control with ObjectDataSource
ASP.NET Page Life Cycle Overview (and quick sheet)
A reference to the GridView can be obtained by using gridViewRow.Parent.Parent or (GridView) gridViewRow.NamingContainer(quote from here).
So I’ve created the static function:
In code-behind pages that use C#, because the control name will not appear in the drop-down list.
Math.Max Method doesn’t have overload for DateTime
public static DateTime Min(DateTime t1, DateTime t2)
{
if (DateTime.Compare(t1, t2) > 0)
{
return t2;
}
return t1;
}
public static DateTime Max(DateTime t1, DateTime t2)
{
if (DateTime.Compare(t1, t2) < 0)
{
return t2;
}
return t1;
}
I’ve done quite a few web UI changes, including CSS styles and javascript testing in IE. Now I have to ensure, that it also work in FioreFox.
The line in javascript causing the issue easily figured out using Firebug.
The elem.innerText property is an IE proprietary addition and thus not usually supported by other browsers. Instead you should be getting the “inner text” of the cell using something like the following:
elem.firstChild.nodeValue;
This uses W3C DOM compliant properties to retrieve the text value of the first TextNode of the cell. This makes it more likely to work across browsers.
I’ve asked a question on forum:
AJAX ScriptManager Class has a IsDebuggingEnabled property, that is available in server code. I want in my client Javascript function to determine, do I running debug or release mode.
MS Online Community Support suggested :
You can create a hidden field to the page, then, check the IsDebuggingEnabled property of ScriptManager , if it is true, set the value of the hidden field to “true”, else, false.
It will work, but I expected the method available in some AJAX client library class.
I prefer the first opton for small changes to keep all definitions for the class/selector in one place.
CSS Filters chart describes “Will the browser apply the rule(s)?”.
More discussion are in http://24ways.org/2005/avoiding-css-hacks-for-internet-explorer
I have an ASP.NET AJAX page with several UpdatePanels. If error occured during asyncronous postback, I want to ignore it for some panels and show errors for other updatepanels. The samples that I found(like Customizing Error Handling for ASP.NET UpdatePanel Controls.) suggested to call add_endRequest and from EndRequestEventArgs use error Property .
Dave Ward suggested that In EndRequest, you can check sender._panelsToRefreshIDs. It’s a JavaScript array of UpdatePanel IDs being updated in the partial postback
My question on forum is how can I find which of UpdatePanels caused the particular Request in EndRequestHandler?
I found an idea in comments of How to handle a timeout in an async postback to use response Property (Sys.Net.WebRequestExecutor class.) Then I can access webRequest Property , but what to do next?
Jin-Yu Yin from MSFT suggested to follow these steps:
1. Get which UpdatePanel is updating at the server side. Check these links:
UpdatePanel.IsInPartialRendering Property
Gets a value that indicates whether the UpdatePanel control is being updated as a result of an asynchronous postback.
The IsInPartialRendering property is intended for use by control developers who want to know when an UpdatePanel control is being updated as a result of an asynchronous postback.
2. use try… catch to catch errors, and in catch block, create an new exception which contain information of which updatepanel is updating and throw it.
3. check the information in the error at the client side, process the error based on the information