📄 scriptresource(3).axd
字号:
form.__EVENTARGUMENT.value = eventArgument;
this._onFormSubmit();
}
function Sys$WebForms$PageRequestManager$_doPostBackWithOptions(options) {
this._isCrossPost = options && options.actionUrl;
// note that when DoPostBackWithOptions is used, _doPostBack or _onFormSubmit, one of the two,
// are guaranteed to be called next.
// In both of those methods it is important to clear the isCrossPost flag so subsequent posts that
// don't use DoPostBackWithOptions are not considered cross page posts.
this._originalDoPostBackWithOptions(options);
}
function Sys$WebForms$PageRequestManager$_elementContains(container, element) {
while (element) {
if (element === container) {
return true;
}
element = element.parentNode;
}
return false;
}
function Sys$WebForms$PageRequestManager$_endPostBack(error, response) {
// DevDiv Bugs 130268: There could have been a 2nd request that started while this one was being
// processed. Detect this by comparing the request for the current response to the _request field,
// which stores the latest request that has begun. If they are different, do not clear the state
// data that will be required by the 2nd request's response.
if (this._request === response.get_webRequest()) {
this._processingRequest = false;
this._additionalInput = null;
this._request = null;
}
var handler = this._get_eventHandlerList().getHandler("endRequest");
var errorHandled = false;
if (handler) {
var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, this._dataItems, response);
handler(this, eventArgs);
errorHandled = eventArgs.get_errorHandled();
}
// DevDiv Bugs 130268: See above
if (!this._processingRequest) {
this._dataItems = null;
}
if (error && !errorHandled) {
// DevDiv 89485: throw, don't alert()
throw error;
}
}
function Sys$WebForms$PageRequestManager$_findNearestElement(uniqueID) {
while (uniqueID.length > 0) {
var clientID = this._uniqueIDToClientID(uniqueID);
var element = document.getElementById(clientID);
if (element) {
return element;
}
var indexOfLastDollar = uniqueID.lastIndexOf('$');
if (indexOfLastDollar === -1) {
return null;
}
uniqueID = uniqueID.substring(0, indexOfLastDollar);
}
return null;
}
function Sys$WebForms$PageRequestManager$_findText(text, location) {
var startIndex = Math.max(0, location - 20);
var endIndex = Math.min(text.length, location + 20);
return text.substring(startIndex, endIndex);
}
function Sys$WebForms$PageRequestManager$_fireDefaultButton(event, target) {
// This is a copy of the function WebForm_FireDefaultButton as defined in WebForms.js.
// The purpose is to hook into the WebForm_FireDefaultButton call with the code commented in the middle.
// Other than that, there have been a few minor changes to the code but the logic is the same.
if ((event.keyCode === 13) && !(event.srcElement && (event.srcElement.tagName.toLowerCase() === "textarea"))) {
var defaultButton = document.getElementById(target);
if (defaultButton && (typeof(defaultButton.click) !== "undefined")) {
// Beginning of new code...
// In all but FF this causes the form.onclick event to fire with the button as the event target.
// In FF the the form.onclick event has the current focus control as the target, which prevents the
// default button's server-side click event from firing. So we ensure the correct control is determined
// to have caused the postback by saving the default button before clicking on it. The code in
// onFormSubmit looks for this field and ensures the postback target is the button.
this._activeDefaultButton = defaultButton;
this._activeDefaultButtonClicked = false;
try {
// click is synchronous -- it will immediately cause a form onclick event and then a form onsubmit event
// assuming nothing uses preventDefault() to cancel the event.
defaultButton.click();
}
finally {
// form submission may or may not be occuring after this point
this._activeDefaultButton = null;
}
// ...End of new code
// cancel submission caused by hitting enter in the input control
event.cancelBubble = true;
if (typeof(event.stopPropagation) === "function") {
event.stopPropagation();
}
return false;
}
}
return true;
}
function Sys$WebForms$PageRequestManager$_getPageLoadedEventArgs(initialLoad) {
// -------------+------------------------------------+-----------------------
// Situation | In ID collections | In eventArg property
// -------------+------------------------------------+-----------------------
// Update (exp) | in panelsToRefresh | updated
// Update (imp) | in new, in old, in childUP | created
// Create (exp) | in new, not in old, not in childUP | created
// Create (imp) | in new, not in old, in childUP | created
// Delete (exp) | not in new, in old, not in childUP | ---
// Delete (imp) | not in new, in old, in childUP | ---
// -------------+------------------------------------+-----------------------
// (exp) = explicit
// (imp) = implicit (happened as result of parent UpdatePanel updating)
// --------------------------------------------------------------------------
// in panelsToRefresh = updated
// not updated, in new = created
// else = don't care
// --------------------------------------------------------------------------
var updated = [];
var created = [];
// Default to empty array, else short circuit OR will take care of value
var oldIDs = this._oldUpdatePanelIDs || []; // All panels before update
var newIDs = this._updatePanelIDs; // All panels after update
var childIDs = this._childUpdatePanelIDs || []; // Child panels created after update
var refreshedIDs = this._panelsToRefreshIDs || []; // Parent panels created after update
// in panelsToRefresh = updated
for (var i = 0; i < refreshedIDs.length; i++) {
Array.add(updated, document.getElementById(this._uniqueIDToClientID(refreshedIDs[i])));
}
// If the panel is in the new list and it is either the initial load
// of the page a refreshed child, it is 'created'.
for (var i = 0; i < newIDs.length; i++) {
if (initialLoad || Array.indexOf(childIDs, newIDs[i]) !== -1) {
Array.add(created, document.getElementById(this._uniqueIDToClientID(newIDs[i])));
}
}
return new Sys.WebForms.PageLoadedEventArgs(updated, created, this._dataItems);
}
function Sys$WebForms$PageRequestManager$_getPageLoadingEventArgs() {
// -------------+------------------------------------+-----------------------
// Situation | In ID collections | In eventArg property
// -------------+------------------------------------+-----------------------
// Update (exp) | in panelsToRefresh | updated
// Update (imp) | in old, in new, in childUP | deleted
// Create (exp) | not in old, in new, not in childUP | ---
// Create (imp) | not in old, in new, in childUP | ---
// Delete (exp) | in old, not in new, not in childUP | deleted
// Delete (imp) | in old, not in new, in childUP | deleted
// -------------+------------------------------------+-----------------------
// (exp) = explicit
// (imp) = implicit (happened as result of parent UpdatePanel updating)
// --------------------------------------------------------------------------
// in panelsToRefresh = updated
// not updated, (not in new or in childUP) = deleted
// else = don't care
// --------------------------------------------------------------------------
var updated = [];
var deleted = [];
var oldIDs = this._oldUpdatePanelIDs;
var newIDs = this._updatePanelIDs;
var childIDs = this._childUpdatePanelIDs;
var refreshedIDs = this._panelsToRefreshIDs;
// in panelsToRefresh = updated
for (var i = 0; i < refreshedIDs.length; i++) {
Array.add(updated, document.getElementById(this._uniqueIDToClientID(refreshedIDs[i])));
}
// not in new or in childUP = deleted
for (var i = 0; i < oldIDs.length; i++) {
if (Array.indexOf(refreshedIDs, oldIDs[i]) === -1 &&
(Array.indexOf(newIDs, oldIDs[i]) === -1 || Array.indexOf(childIDs, oldIDs[i]) > -1)) {
Array.add(deleted, document.getElementById(this._uniqueIDToClientID(oldIDs[i])));
}
}
return new Sys.WebForms.PageLoadingEventArgs(updated, deleted, this._dataItems);
}
function Sys$WebForms$PageRequestManager$_getPostBackSettings(element, elementUniqueID) {
var originalElement = element;
// Keep track of whether we have an AsyncPostBackControl but still
// want to see if we're inside an UpdatePanel anyway.
var proposedSettings = null;
// Walk up DOM hierarchy to find out the nearest container of
// the element that caused the postback.
while (element) {
if (element.id) {
// First try an exact match for async postback, regular postback, or UpdatePanel
if (!proposedSettings && Array.contains(this._asyncPostBackControlClientIDs, element.id)) {
// The element explicitly causes an async postback
proposedSettings = this._createPostBackSettings(true, this._scriptManagerID + '|' + elementUniqueID, originalElement);
}
else {
if (!proposedSettings && Array.contains(this._postBackControlClientIDs, element.id)) {
// The element explicitly doesn't cause an async postback
return this._createPostBackSettings(false, null, null);
}
else {
var indexOfPanel = Array.indexOf(this._updatePanelClientIDs, element.id);
if (indexOfPanel !== -1) {
// The element causes an async postback because it is inside an UpdatePanel
if (this._updatePanelHasChildrenAsTriggers[indexOfPanel]) {
// If it was in an UpdatePanel and the panel has ChildrenAsTriggers=true, then
// we do an async postback and refresh the given panel
// Although we do the search by looking at ClientIDs, we end
// up sending a UniqueID back to the server so that we can
// call FindControl() with it.
return this._createPostBackSettings(true, this._updatePanelIDs[indexOfPanel] + '|' + elementUniqueID, originalElement);
}
else {
// The element was inside an UpdatePanel so we do an async postback,
// but because it has ChildrenAsTriggers=false we don't update this panel.
return this._createPostBackSettings(true, this._scriptManagerID + '|' + elementUniqueID, originalElement);
}
}
}
}
// Then try near matches
if (!proposedSettings && this._matchesParentIDInList(element.id, this._asyncPostBackControlClientIDs)) {
// The element explicitly causes an async postback
proposedSettings = this._createPostBackSettings(true, this._scriptManagerID + '|' + elementUniqueID, originalElement);
}
else {
if (!proposedSettings && this._matchesParentIDInList(element.id, this._postBackControlClientIDs)) {
// The element explicitly doesn't cause an async postback
return this._createPostBackSettings(false, null, null);
}
}
}
element = element.parentNode;
}
// If we have proposed settings that means we found a match for an
// AsyncPostBackControl but were still searching for an UpdatePanel.
// If we got here that means we didn't find the UpdatePanel so we
// just fall back to the original AsyncPostBackControl settings that
// we created.
if (!proposedSettings) {
// The element doesn't cause an async postback
return this._createPostBackSettings(false, null, null);
}
else {
return proposedSettings;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -