That makes sense. Cross-page posting (postbackurl) didn't exist in .NET 1, so there were no client scripts to do the job.
It was a javascript problem after all!
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: ASP .NET and IIS 6 problem
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "ASP .NET and IIS 6 problem"
Collapse
-
Aha!
The problem was that I hadn't associated .axd files on the server with .NET2. I guess that's an autogenerated thing because I don't have any, but I notice that returned HTML includes script from one of those. Not suprising that the script from .NET1 wouldn't work with the HTML from .NET2, though the error could have been a bit more helpful.
Doh!
Thanks everyone for helping. Isn't it always the way that you only spot your stupid mistake after you ask others for help?
Leave a comment:
-
[QUOTE=VectraMan;1086809]The problem is these image buttons are dynamically generated, and I don't seem to be able to add an OnClick in the same way that I do in .aspx.[QUOTE]
This might help. Adding an event handler to a control...
Code:img.Click+=new EventHandler(img_Click);
Leave a comment:
-
Originally posted by lightng View PostIf you use "CommandName" and "CommandArgument" parameters for your image buttons, this will enable you to use the same event handler for your buttons and give you the ability to pass parameters.
I've found another problem, which maybe sheds some light on the first one:
On a different form I have a validator:
Code:<asp:TextBox id="creditCardNumber" runat="server" Width="215px" /> <asp:RequiredFieldValidator runat="server" id="RequiredFieldValidator2" ControlToValidate="creditCardNumber" display="Dynamic" >!</asp:RequiredFieldValidator>
It does seem the servers are doing something different. Both are running .NET 2.0.50727. Is there some other IIS6 update I need to install perhaps? Not that I can find (it it has W2003 SP1).
Leave a comment:
-
That is an odd problem Vectraman!
If you use "CommandName" and "CommandArgument" parameters for your image buttons, this will enable you to use the same event handler for your buttons and give you the ability to pass parameters.
Leave a comment:
-
It ends up like this, which is right as far as I can decypher it:
Code:<input type="image" name="ctl04" src="images/cartbuttons/decrease_quantity.gif" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl04", "", false, "", "Basket.aspx?decqty=y&item=1", false, false))" style="border-style:None;height:14px;width:20px;border-width:0px;" />
I have in my aspx:
Code:<form id="form1" runat="server" action="Basket.aspx">
I have another asp:button on the page which has an OnClick handler, and that works properly. So maybe I just need to work out how to do that instead.
Could this be a caching thing? I tried setting the content expiration options on the server to immediate, but that hasn't affected anything.
Thanks for listening.
Leave a comment:
-
PostBackUrl relies on javascript to change the form post action before submitting. It's a bizarre one given the facts presented so far but I would check...
Do you get any javascript errors?
Have you checked the page source especially around the html created for the imagebutton controls?
Is "Basket.aspx?addqty=y&item=" + basketID evaluating to a string correctly?
Leave a comment:
-
It's an ASP table that I'm dynamically adding things to (I didn't know any other way), like this:
Code:ImageButton img = new ImageButton(); img.ImageUrl= "images/cartbuttons/increase_quantity.gif"; img.Width = 20; img.Height = 14; img.BorderStyle = BorderStyle.None; c5.BackColor = Constants.clrBack; img.PostBackUrl = "Basket.aspx?addqty=y&item=" + basketID; c5.Controls.Add(img);
The quantities are stored in the DB, so surely it has to be handled by the server. But maybe I should be using an event rather than a PostBackURL?
Leave a comment:
-
Originally posted by Durbs View PostIf the former, make sure you aren't using server.transfer as this'll render your querystring shenanigans non-functional.
Show us the code. We could be way off mark here.
Leave a comment:
-
When you say 'up button' is this a server control running an onclick event like response.redirect/server.transfer or simply an image you've assigned a dynamic href="xxx" link to?
If the former, make sure you aren't using server.transfer as this'll render your querystring shenanigans non-functional.
If the latter then you should really be handling the quantity change within the click event (ideally asynchronously) rather than reading the querystring on postback page load.
Edited, also check that the click isn't triggering a validator elsewhere on the page, i've had that happen before where an onclick event wont fire because the validation is failing on a form elsewhere. In that case set the 'CausesValidation' to false on the button.Last edited by Durbs; 1 March 2010, 18:40.
Leave a comment:
-
This may be a stupid question but you're not using server code behind to try to update the URL are you? If so, it won't work - your URL will always be a page behind.
If you post the code, I'm sure someone will be able to help. I'll have a look myself later when I'm back on - that's if someone hasn't got back to you first, of course.
Leave a comment:
-
It's the server that's different. Same client machine and browser (and IE and Firefox do the same).
Leave a comment:
-
Is this using the same browser or perhaps the one on the machine? I only mention that because win2k3 has some settings to disable javascript on sites which aren't trusted.
Leave a comment:
-
ASP .NET and IIS 6 problem
I have a shopping basket system that's based on one written many a year ago in Perl. The initial link is something like:
Basket.aspx?addtobasket=500
where 500 refers to the product. The basket has up and down buttons, which call, for example
Basket.aspx?incqty=500
On VS2005 and whatever its test webserver is, this all works, and when I click on an up button it reloads the page increasing the quantity, and I notice that the URL in the browser address bar changes to the above.
However uploaded to where it needs to go (a Windows 2003 IIS6 server), the up and down buttons don't work. If I click the down arrow, it reloads the page but the original "addtobasket" URL remains in the browser address bar and it carries out the addtobasket function rather than the increase/decrease.
Can anyone shed any light on this? Maybe it's not the best approach, and I'm still feeling my way, but why does it not work consistently?Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Gary Lineker and HMRC broker IR35 settlement on the hush Today 09:10
- IT contractor jobs market sinks to four-year low in November Yesterday 09:30
- Joke of the Day Dec 9 14:57
- How company directors can offset employer NIC rising to 15% Dec 9 10:30
- Contractors, seen Halifax’s 18-month fixed rate remortgage? Dec 5 09:59
- Contractors, don’t be fooled by HMRC Spotlight 67 on MSCs Dec 4 09:20
- HMRC warns IT consultants and others of 12 ‘payroll entities’ Dec 3 09:15
- How you think you look on LinkedIn vs what recruiters see Dec 2 09:00
- Reports of umbrella companies’ death are greatly exaggerated Nov 28 10:11
- A new hiring fraud hinges on a limited company, a passport and ‘Ade’ Nov 27 09:21
Leave a comment: