Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 2nd, 2011, 06:54 AM
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
Exclamation Cross-Page posting not working

I am doing the cross-page posting topic from the book.

I copied the whole code from Listings 1-9 & 1-10 in the corresponding web forms Page1.aspx & Page2.aspx

And then run the web app.

Page1 was shown. I entered name & selected the date.
Then clicked "Submit page to itself" button. It is giving responce as expected.

But when I click "Submit page to Page2.aspx" button, the page simple flashes up again showing Page1, even not refreshing its field & the previous responce.

Whats wrong?

Please guide!!!

Tried many times. But no success.

I stuck over here.

Waiting for your help. Thank you!!!!

Code:
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>

Last edited by Mahesha999; July 2nd, 2011 at 06:56 AM.. Reason: Adding code
  #2 (permalink)  
Old July 2nd, 2011, 07:55 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

This code works fine for me. Are both of your pages located in the root of the site? And is JavaScript enabled in your browser?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #3 (permalink)  
Old July 2nd, 2011, 01:09 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 Oh!!!! The Author!!!!! (Need more help)

Oh!!!! Shocked!!!! The author!!!!

Thanks sir for your help. But still the problem persist.

I learnt many topics in ASP.NET earlier. The problem is that I never keep in touch with them. So I forget.

Javascript is enabled. I tried in all Firefox 4, IE 9 & Crome 10.

The web site directory hierarchy is as shown in the image:
http://img707.imageshack.us/img707/6...ageposting.png

Please help. Thank you.
  #4 (permalink)  
Old July 3rd, 2011, 06:07 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

An author yes, but not of this book.... ;-)

Maybe the issue is caused by configuration issues in IIS? From your Solution Explorer it looks like your site is running against IIS. Does it work for you when you try this:

1. In VS2010 choose File | New Web Site (not File | New Project)
2. Create a new C# Web Site
3. Drag Page1 and Pag2 into the new site
4. Hit F5

That works fine for me.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #5 (permalink)  
Old July 4th, 2011, 05:50 AM
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

Sir, its still not working

Infact I was doing exactly what you told me (but I created the new web application & the virtual directory under the default web site. (printscreen:http://img231.imageshack.us/img231/8787/locationg.png).)

Earlier, I also tried it by creating the C# web Application:
(File->New->Project->ASP.NET Web Application), instead of (File->New->WebSite). But both ways it did not worked.

I also tried by having my web-site on the file system (by selecting the "File System" in Location dialog). But still hitting button2 postbacks to same page, simply flashing Page1.

Googling whole day. I am not finding any way out. Please help.

Last edited by Mahesha999; July 4th, 2011 at 05:52 AM.. Reason: adding text
  #6 (permalink)  
Old July 4th, 2011, 06:26 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
Infact I was doing exactly what you told me (but I created the new web application & the virtual directory under the default web site.
A web application is not a web site. So can you please try it again using File | New Web SIte and then chosing the FIle System option? A Web Application uses IIS, which may be causing the issue.

If you have the same issue on a file based web site, the problem may be elsewhere. Maybe you have anti virus software on your machine blocking the functionality?

What do you see when you look at the source of the Page1 in the browser?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #7 (permalink)  
Old July 4th, 2011, 03:40 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 No success yet

I did exactly in the way asked, i.e. by choosing “File System” in the “Choose Location” dialog box.

Now the application is running under “ASP.NET Development Server” as shown in the notification area of the taskbar.

Also tried by turning off the BitDefender antivirus & firewall. But no success.

Here is the HTML source as can be seen from the Crome
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>
  #8 (permalink)  
Old July 4th, 2011, 04:06 PM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I compared your code with mine, and besides the few obvious differences, I see no reason why this shouldn't work.

Final two things to check before I am out of ideas:

1. Make sure JavaScript is enabled by writing some simple JavaScript code in the page.

2. Request the axd file directly and see if that shows something. E.g. make a request for something like http://localhost:1234/PostBackUrl/We...89204126647261

Make sure you use your own port number and exact URL (which you can find by looking at the source in the browser).

Other than that, I am out of ideas. Did you search Google for people with similar problems?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #9 (permalink)  
Old July 5th, 2011, 03:25 AM
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

JavaScript is working
This is the modified Page1.aspx to include an additional button that runs the JavaScript

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page1.aspx.cs" Inherits="Page1" %>

<!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 runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
// <![CDATA[

        function Button3_onclick() {
            //http://img715.imageshack.us/img715/7631/javascriptisactive.png
            alert("This is to test if the JavaScript works or not.");
        }

// ]]>
    </script>
</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" />
            <input id="Button3" type="button" value="Run JavaScript" onclick="return Button3_onclick()" />
        <p>
        <asp:Label ID="Label1" Runat="server"></asp:Label></p>
    </form>
</body>
</html>
Output Printscreen: http://img715.imageshack.us/img715/7...ptisactive.png

In the browser's html source window, the axd file's url seems something like this:

Code:
<script src="/PostBackUrl/WebResource.axd?d=yXPd-6jqJU9yUpgUop_GXLe959_q_LG_ul4NaiPWx5aj8oORGZE2cl-TVJKxf2ByJM96bXDpnwEuvNuyiPa56bnJZ75zvzulLnpDXuabk481&amp;t=634589204126647261" type="text/javascript"></script>
But when tried to request the file directly, following error occured:http://img841.imageshack.us/img841/9939/axderror.png

I googled for the same.
many people had this problem (about the postback, not specific to the axd file), they found different solutions that did not worked for me.

merk (third post) talked about the axd file problem at http://forums.asp.net/t/1052857.aspx/1. But did not explained how solved it to the length:

Last edited by Mahesha999; July 5th, 2011 at 03:28 AM.. Reason: edit
  #10 (permalink)  
Old July 5th, 2011, 08:37 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

That at least explains why the postback doesn't work.

Not sure why the files turn up as 404's. Could be an issue with IIS or the ASP.NET framework.

You could try repairing ASP.NET, or try this Google search.

Other than that, I am really out of ideas now..

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cross-page posting DragonLEG BOOK: Professional ASP.NET 4 : in C# and VB 0 June 8th, 2011 05:35 PM
Cross-Page Posting roman BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 June 25th, 2008 10:25 AM
cross-page posting within pages with master file.. poogles ASP.NET 2.0 Basics 2 August 6th, 2007 05:11 AM
cross-page posting macupryk Visual Studio 2005 0 December 17th, 2004 06:58 PM
Form posting not working on Win32 but OK on linux synergz BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 July 21st, 2003 11:37 AM



All times are GMT -4. The time now is 12:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.