I am having a developed application and everything works perfectly in visual studio 2010 in local machine.but when I deploy my application in IIS7 classic pool mode, the ajax controls are working fine initially.But once postback is happening none of the of Ajax controls are working?
Please help me in this.
What do you mean by none of them are working?
Shot in the dark, you are likely removing and reloading dom elements that you bound to events previously. Once the new dom elements are loaded you will need to rebind any events such as click to them at that point.
Related
I've been working on an ASP.NET web application and I recently got a new laptop. I was using Visual Studio Community 2019 using .NET Framework 4.7.2 on my old laptop, so I made sure to get the exact same software/version on my new one. I used Git to clone my project on my new laptop so I'm sure everything is the same. Both laptops are running Windows 10 Home edition.
For some reason on my new laptop, when viewing a .aspx page, the AJAX controls are underlined in green, and when I hover over them with my cursor, I see an error message saying "Element 'x' is not a known element." This happens with all the AJAX controls and with other controls defined within the AJAX controls. Strangely, if I view another .aspx page, the AJAX controls on that page are recognized. What I noticed is whichever .aspx page is opened first will have the unrecognized AJAX controls error, and all other .aspx pages won't have it. Also strange is the project seems to work just fine when I run it, with the AJAX controls that aren't recognized working normally.
The same project open on my old laptop doesn't have this problem. Am I missing some dll file on my new computer? How would I be able to tell what's missing?
I have an ASP.NET Web Application using .NET Framework 4 and it is working fine on all browser when I test it locally using my Visual Studio Pro 2010, but when we deploy it to our server (IIS7 on Windows Server 2008 R2), the LinkButtons of my Web Application is not working correctly on Safari Browser on all platforms.
What was happening was when the LinkButton has a function that uses Response.Redirect, it somewhat clears the session or doesn't save it. I can check this since when I redirect to another page, I save the values inputted to a session first before redirecting, and validate it to the redirected page and if there's no session, bring it back to the previous page.
I have already implemented this fix to add a .browser file to my webapp but it doesn't fix my problem. I also tried this answer from SO to add a Page_PreInit and a configuration but to no avail.
My IIS Configuration has enabled for both Session and Cookies, and I honestly do not see why it will only affect Safari Browser if it is a server configuration error.
I've been working on this bug for a whole day and I can't still fix this. Please help, thanks in advance.
Update: I forgot to mention that my website is inside an iframe, after researching further I have found this question that says that Safari doesn't allow Third-Party Cookie by default. Now I can't use the said fix since my application is in ASP.NET not in PHP.
I have a situation where all client OnClick events have stopped working when the code is hosted under IIS, yet work perfectly when run in the VS2010 environment.
The page is a simple ASPX page with one textbox and one linkbutton on, the linkbutton OnClick calls an event handler btnMyButton_Click.
When run under IIS, the event handler is never called (I have stepped through the code to determine this) but the page is posted. When run under VS2010, the event handler is called as wanted.
The IIS environment is Windows 7, IIS 7.5, ASP.Net 4.0 with an integrated AppPool.
This has also been verified on a Windows Server 2008 R2 server, again with IIS 7.5, ASP.Net 4.0 and an integrated AppPool.
I have tried turning off Event Validation for the page, no dice.
Does any one have any ideas?
Edited to add: Ok, some significant new info. The issue is down to how you visit the page:
http://mydomain.com/SomeFolder/ <- when visited using this url, the OnClick events do not fire
http://mydomain.com/SomeFolder/Default.aspx <- when visiting using this url, everything works as normal
And the answer to this one is simple, but quite buried :)
I had "runAllManagedModulesForAllRequests" set to true in the system.Webserver modules block in the web.config.
Even tho I had no modules defined (just http handlers), it was still causing issues - set it to false and normal service resumed.
In my case, it was a bad IIS configuration (I removed them all and now it works):
I set a reference to AjaxControlToolkit.dll and this added all of the toolkit's controls to my toolbar. I then tried to drag and drop one of the controls to my webform and nothing happened-no error message, no control added to the form. Double clicking the control also did nothing.
The web site compiles with no errors, I also tried to bounce VS2008. I am running Developers Edition on Windows Server 2008.
I was able to add a Script Manager control
This worked w/o issue on my other computers.
Also, make sure you drop the tools into the source tab of your ASP page. As many of these controls has no graphical representation.
Ajaxtoolkit controls in VS2008 are extenders of other controls. Add the parent control first.
I am using VS 2008 with a very simple UpdatePanel scenario.
But i cannot get UpdatePanel to work and cant seem to find out why
I have in fact reverted to a very simple example to validate it is not my code:
http://ajax.net-tutorials.com/controls/updatepanel-control/
In this example I click on either button and both text links update.
I dont get any errors, the page just behaves like a normal ASPX page.
What things do i need to check. I've been googling this for an hour and not found what I need.
Edit: Works in Visual Studio web server but not in IIS
If it's working locally, but not when deployed to a remote server, that usually indicates that you're using ASP.NET 2.0 and the ASP.NET AJAX extensions aren't installed on the remote server.
If it's a server you have administrative control over, you can download the installer here: http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en
If it's a web host, tell them to get their act together.
Another option would be to check your web.config. You could for example create an new Ajax enabled ASP.NET website from Visual Studio. This will generate a correct web.config. Copy over all non-ajax sections from your existing web.config and you're set. This worked for me.
-Edoode