Why is my ASP.NET page embedding this Javascript file in WebResource.axd?

When I look at the source on my ASP.NET page, I get the following snippet:

<script type="text/javascript"> 
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script> 

<script src="/WebResource.axd?d=5lheyan7fritNTjDRpG8vA2&amp;t=633734967316503584" type="text/javascript"></script> 

The .aspx file is as follows:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NaturalDateDemo._Default" %>

<form id="form1" runat="server" enableviewstate="False">
   Enter something to parse:<br />
   <asp:TextBox ID="TextBox1" runat="server" Width="270px"></asp:TextBox>
   <asp:Button ID="Button1" runat="server" Text="Parse" PostBackUrl="Default.aspx" CausesValidation="False" EnableViewState="False" UseSubmitBehavior="true" />
</form>

Both pieces of code (the literal code and the material in /WebResource.axd) seem to be related to the execution of JavaScript post-backs, and I cannot think of any reason that my page would require JavaScript to execute the feedback.

  • What does it do?
  • Where is he from?
  • Can I get rid of him?
  • How can I get rid of it?

The page for this question comes from


A little Google work found this , indicating that checking controls will lead to this, but I don't think I have any checks.

WebResource.axd , , .


, , , onclick JavaScript. , FireBug, , ( HTTP ), , . OTOH __EVENTVALIDATION, ( ), .


, , , (?) ASP.NET - - JavaScript, HTML- . ( , MS, ASP.NET JavaScript, , .)

, , , . ( , , , "-", , JS.) ASP.NET, , HTTP- POST , , , , , .

+5
5

, , : PostBackUrl Button, JavaScript , ​​ .

JavaScript HTML , , <form action="...">. ASP.NET , PostBackUrl Button. , JavaScript: - post-back.

PostBackUrl <form> action, , -, ASP.NET , script.

+13

4 :

  • UpdatePanel - ?
  • javascript, - ?
  • - , ?
  • - ?

, , , , , .

- ASPX?

: . , ( , ). URL- webresource javascript, . , .

# 2: , .NET, . , . , - HTML URL. POST URL- . .NET . , , javascript?

+3

postbacks.NET .NET MVC. , postbacks ,.NET javascript, . - MVC.

+1

, , " - , [] -". , Parse , , , .

, ASP.Net? , "MS " ( Jay S , , , ), , , , , , JavaScript , ASP.Net, ASP.Net -. , , , .

0

, , ,

0
source

All Articles