Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional IIS 7 and ASP.NET Integrated Programming ISBN 978-0-470-15253-9
This is the forum to discuss the Wrox book Professional IIS 7 and ASP.NET Integrated Programming by Dr. Shahram Khosravi; ISBN: 9780470152539
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional IIS 7 and ASP.NET Integrated Programming ISBN 978-0-470-15253-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)   Spam!  
Old July 5th, 2011, 02:55 PM
Authorized User
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default ".axd file not found" stops functionality of PostBackUrl

Hi there, I thought this book's forum is better place to share this problem since I think .axd is something related to IIS configurations

Basically, I am trying cross-page postbacks in ASP.NET.
The same problem persisted for callbacks.

My website has two pages: Page1.aspx & Page2.aspx.

Page1.aspx has two buttons. Button1 calls its Button1_Click
while Button2 postbacks to Page2.aspx using its PostbackUrl.

Button1 click works fine, however Button2 click doesn't. It simply flashes the page, giving behavior as posting back to the Page1 itself.

When looked at the html source in the browser, found the link to the axd file.
When this file is queried directly, 404 resource not found error occured (printscreen:http://img841.imageshack.us/img841/9939/axderror.png).

Anyone knows why is this WebResource.axd file missing? Please Help.

Some points:
1. The JavaScript is working on all browsers IE9, Crome10 & Firefoxx4
2. I tried by turning off the firewall.
3. I also tried by running the app on the ASP.NET Development Server i.e.
through the File System (so does that mean its not IIS specific?)

Below is the code for Page1.aspx, Page2.aspx & Html source of the Page1.aspx in Crome

Page1.aspx
Code:
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        Label1.Text = "Hello " + TextBox1.Text + "<br />" +
        "Date Selected: " + Calendar1.SelectedDate.ToShortDateString();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        Enter your name:<br />
        <asp:Textbox ID="TextBox1" Runat="server"></asp:Textbox>
        <p>
            When do you want to fly?<br />
            <asp:Calendar ID="Calendar1" Runat="server"></asp:Calendar></p>
            <br />
            <asp:Button ID="Button1" Runat="server" Text="Submit page to itself" OnClick="Button1_Click" />
            <asp:Button ID="Button2" Runat="server" Text="Submit page to Page2.aspx" PostBackUrl="~/Page2.aspx" />
        <p>
        <asp:Label ID="Label1" Runat="server"></asp:Label></p>
    </form>
</body>
</html>
Page2.aspx
Code:
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    {
        TextBox pp_Textbox1;
        Calendar pp_Calendar1;
        pp_Textbox1 = (TextBox)PreviousPage.FindControl("Textbox1");
        pp_Calendar1 = (Calendar)PreviousPage.FindControl("Calendar1");
        Label1.Text = "Hello " + pp_Textbox1.Text + "<br />" + "Date Selected: " +
        pp_Calendar1.SelectedDate.ToShortDateString();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Label ID="Label1" Runat="server"></asp:Label>
    </form>
</body>
</html>
Page1's HTML Source
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
	
	<html xmlns="http://www.w3.org/1999/xhtml"> 
	<head><title> 
	
	</title></head> 
	<body> 
	<form method="post" action="Page1.aspx" id="form1"> 
	<div class="aspNetHidden"> 
	<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> 
	<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> 
	<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE5MzM1MTM2MzMPZBYCAgMPZBYEAgMPPCsACgEADxYCHgJTRBYBBgCAZfEGD84IZGQCCQ8PFgIeBFRleHQFKkhlbGxvIE1haGVzaDxiciAvPkRhdGUgU2VsZWN0ZWQ6IDcvMTMvMjAxMWRkZIHfZ7FDHTHhw+zjjYsG0rjn+JV8AicRXCqaIQ7Vu+Z0" /> 
	</div> 
	
	<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="/PostBackUrl/WebResource.axd?d=yXPd-6jqJU9yUpgUop_GXLe959_q_LG_ul4NaiPWx5aj8oORGZE2cl-TVJKxf2ByJM96bXDpnwEuvNuyiPa56bnJZ75zvzulLnpDXuabk481&amp;t=634589204126647261" type="text/javascript"></script> 

	
	<div class="aspNetHidden"> 
	
	<input type="hidden" name="__PREVIOUSPAGE" id="__PREVIOUSPAGE" value="5K-qVQ5ErNPEBHVtoLZPE8bOGk2SM7-_0f9twN6s0W12WUFhwjQbnZrdV_8Jr6VTOV1msVJoSYWliMenalsDM14-Kj2BYUKKxdgbK4VO3qg1" /> 
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWMAKD0PzVCALs0bLrBgLcrveCCgKwxN67DgLZ9+GJDQLZ992kBgLZ98nfDwLZ96V7Atn30cMFAtn3zf4OApaUjIgLApaU+KMMApaU1N4FApaUwPkOApaUvJUGApaUqLAPApaUhGsClpTwhggClpSs7w4ClpSYigYC8a2qkwEC8a2GzgoC8a3y6QMC8a3uhAsC8a3avwwC8a222wUC8a2i9g4C8a2ekQYC8a3K+QQC8a2mlQwC7LrIvQ8C7LqkWQLsupD0CQLsuoyvAQLsuvjKCgLsutTlAwLsusCACwLsury8DALsuuiEAQLsusS/CgLH09fIBQLH08PjDgLH07+fBgLH06u6DwLH04dVAsfT8/AJAoznisYGArursYYI+k7s8PddlfZL/XTTLWRLi8jsbr3GEAm31z5OzdWc/2c=" /> 
	</div> 
	Enter your name:<br /> 
	<input name="TextBox1" type="text" value="Mahesh" id="TextBox1" /> 
	<p> 
	When do you want to fly?<br /> 
	<table id="Calendar1" cellspacing="0" cellpadding="2" title="Calendar" style="border-width:1px;border-style:solid;border-collapse:collapse;"> 
	<tr><td colspan="7" style="background-color:Silver;"><table cellspacing="0" style="width:100%;border-collapse:collapse;"> 
	<tr><td style="width:15%;"><a href="javascript:__doPostBack('Calendar1','V4169')" style="color:Black" title="Go to the previous month">&lt;</a></td><td align="center" style="width:70%;">July 2011</td><td align="right" style="width:15%;"><a href="javascript:__doPostBack('Calendar1','V4230')" style="color:Black" title="Go to the next month">&gt;</a></td></tr> 
	</table></td></tr><tr><th align="center" abbr="Sunday" scope="col">Sun</th><th align="center" abbr="Monday" scope="col">Mon</th><th align="center" abbr="Tuesday" scope="col">Tue</th><th align="center" abbr="Wednesday" scope="col">Wed</th><th align="center" abbr="Thursday" scope="col">Thu</th><th align="center" abbr="Friday" scope="col">Fri</th><th align="center" abbr="Saturday" scope="col">Sat</th></tr><tr><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4194')" style="color:Black" title="June 26">26</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4195')" style="color:Black" title="June 27">27</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4196')" style="color:Black" title="June 28">28</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4197')" style="color:Black" title="June 29">29</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4198')" style="color:Black" title="June 30">30</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4199')" style="color:Black" title="July 01">1</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4200')" style="color:Black" title="July 02">2</a></td></tr><tr><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4201')" style="color:Black" title="July 03">3</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4202')" style="color:Black" title="July 04">4</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4203')" style="color:Black" title="July 05">5</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4204')" style="color:Black" title="July 06">6</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4205')" style="color:Black" title="July 07">7</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4206')" style="color:Black" title="July 08">8</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4207')" style="color:Black" title="July 09">9</a></td></tr><tr><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4208')" style="color:Black" title="July 10">10</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4209')" style="color:Black" title="July 11">11</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4210')" style="color:Black" title="July 12">12</a></td><td align="center" style="color:White;background-color:Silver;width:14%;"><a href="javascript:__doPostBack('Calendar1','4211')" style="color:White" title="July 13">13</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4212')" style="color:Black" title="July 14">14</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4213')" style="color:Black" title="July 15">15</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4214')" style="color:Black" title="July 16">16</a></td></tr><tr><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4215')" style="color:Black" title="July 17">17</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4216')" style="color:Black" title="July 18">18</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4217')" style="color:Black" title="July 19">19</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4218')" style="color:Black" title="July 20">20</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4219')" style="color:Black" title="July 21">21</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4220')" style="color:Black" title="July 22">22</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4221')" style="color:Black" title="July 23">23</a></td></tr><tr><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4222')" style="color:Black" title="July 24">24</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4223')" style="color:Black" title="July 25">25</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4224')" style="color:Black" title="July 26">26</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4225')" style="color:Black" title="July 27">27</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4226')" style="color:Black" title="July 28">28</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4227')" style="color:Black" title="July 29">29</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4228')" style="color:Black" title="July 30">30</a></td></tr><tr><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4229')" style="color:Black" title="July 31">31</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4230')" style="color:Black" title="August 01">1</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4231')" style="color:Black" title="August 02">2</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4232')" style="color:Black" title="August 03">3</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4233')" style="color:Black" title="August 04">4</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4234')" style="color:Black" title="August 05">5</a></td><td align="center" style="width:14%;"><a href="javascript:__doPostBack('Calendar1','4235')" style="color:Black" title="August 06">6</a></td></tr> 
	</table></p> 
	<br /> 
	<input type="submit" name="Button1" value="Submit page to itself" id="Button1" /> 
	<input type="submit" name="Button2" value="Submit page to Page2.aspx" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;Button2&quot;, &quot;&quot;, false, &quot;&quot;, &quot;Page2.aspx&quot;, false, false))" id="Button2" /> 
	<p> 
	<span id="Label1">Hello Mahesh<br />Date Selected: 7/13/2011</span></p> 
	</form> 
	</body> 
	</html>


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trace.axd Error shariful ASP.NET 3.5 Basics 1 November 8th, 2011 10:37 AM
Invoking or calling a sqlldr control file and using e-mail functionality in perl msrblr Perl 1 March 2nd, 2011 02:16 AM
Performance observation - WebResource.axd finnur BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 August 2nd, 2007 05:59 AM
Precompile.axd pro-logic ASP.NET 2.0 Professional 0 December 4th, 2005 09:38 PM
File Download Functionality In Flash? Ben Horne Flash (all versions) 1 April 25th, 2004 06:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.