Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, March 28, 2012

Updateprogress panel does not disappearing

Hello:

I have a web page with updatepanel and updateprogress. In each callback, updateprogress is showed with a panel "loading".

My problem is that, if I call other web page that opens one PDF in other window, updateprogress does not disappear from the screen:

In button click I have:

Response.Redirect(

"getDocument.aspx",false); //This page does not load on same explorer. It is opened in other window

I have tried adding code at bottom of this sentence, like "UpdatePanel1.Update();" or updateprogress1.visible=false, but no way.

Any ideas?

Thanks and regards

How you are loading the response in another explorer using Response.Redirect or are you opening the window from the client side?

refer this tutorial also:

http://ajax.asp.net/docs/tutorials/ProgrammingUpdateProgress.aspx

referDisplaying Update Progress Using Client Script in the above page.This describes how to intercepte page request manager lifecycle.


Hello and thanks by responding:

I am calling a web page called Getdocument.aspx from code behind (on rowcommand of datagrid). Not from client-side.

This web page "GetDocument.aspx", generates a PDF file with Response.binaryWrite and open it in a new browser. But caller page remains or must remain active.

Regards

UpdateProgress with DropDownList Controls (or others)

I have a UpdateProgress control that works with the submit button; how do I get it to work with a dropdown list that gets populated from a web service? Thanks.

Dan

I am not sure, if i had understood your problem correctly. An UpdateProgress control is attached to an update panel. So it doesnt matter if the post back is caused by a button or a dropdownlist. Make sure you have the dropdownlist in the updatepanel for which the updateprogress is attached.

Thanks

UpdateProgressControl/UpdatePanel timeout

I have a main ASP.NET 2.0 web form (C# code-behind) that has an "inbox" that displays records from a database. The main web form has a AspTimer control and an UpdatePanel control that are used in concert to refresh the inbox every 2 minutes (120000ms) triggered by the timers Tick event. However, when a user creates a new record using another web form I am triggering an async refresh of the inbox (after the record is saved) by calling a javascript function (via ModalPopupExtender OnOkScript value) that detects the presence of a hidden button on the main form and firing it's click event which is handled as an asp:AsyncPostbackTrigger for the main web forms update panel. Everything works as designed, but from time to time after the remote page triggered refresh occurs the next timer refresh (Tick event) or other user initiated event (e.g. gridview row select, sort) will hang and result in an "Sys.WebForms.PageRequestManager TimeoutException: The Server request timed out."error. I am not sure if the remote page triggered refresh is confusing the AspTimer somehow or it is causing a collision of some sorts but any thoughts on the matter would be much appreciated.

Further details/update: Once I get the "Sys.WebForms.PageRequestManagerTimeoutException" error, I can consistentely get it to occur by clicking a button that triggers an async postback. It's as if the session has lost it's connection (note that this happens regardless if I am running against my local development machine (XP/IIS51) or our test server (2003/IIS6)). The very weird thing that is befuddling me is that if I use fiddler to watch the traffic to see what is going on it (the connection) will be magically restored and everything works fine again. There are no server side errors being thrown and JavaScript console in (NS/FireFox) does not show anything that would point me to a resolution.


Eureka!!! I figured out the problem. I have JavaScript methods that are called by my child forms when a user is clicking the "Close/Cancel" button that verify there are no unsaved changes before closing otherwise user is prompted to verify that they want to discard changes or not. If they confirmed that they wanted to close the web form I was simply calling window.close() but was not returning any value from the function which I think was a problem because the Close/Cancel button is located within the update panel (because the image changes depending on the scope of the form (e.g. new or view)) and thus despite closing the window I think the AJAX event lifecycle was being initiated but terminated abnormally because of the form closing. I added a "return false;" in my finally clause for all the functions that are used in the closing of a child web form and lo and behold my parent form no longer breaks (see example function below - added statement is bolded). I hope this solution also works for anyone else having a similar problem:

// Function Name: CloseVisitLog
// Function Purpose: Close the visit log form.
// Author: Michael Jensen
function CloseVisitLog(scope)
{
// put function within try-catch-finally block
try
{
// debug statement - set debug = true to view
if (debug) alert(">>Entered JavaScript:CloseVisitLog");

// declare local variables
var unsavedChanges = GetUnsavedChangesFlag();

if(scope == "new")
{
// make sure the user really wants to cancel
if (confirm("Are you sure you want to cancel creation of this visit log entry?"))
{
// close the window
window.close();
}
else
{
return false;
}
}
else if(scope == "view")
{
// if there are unsaved changes make sure the user really
// wants to close
if(unsavedChanges == "true")
{
if (confirm("There are unsaved changes, are you sure you want to close?"))
{
// close the window
window.close();
}
else
{
return false;
}
}
else
{
// close the window
window.close();
}
}
}
catch(ex)
{
var msg = "JavaScript:CloseVisitLog failed. ";
alert(msg + ex.messsage);
}
finally
{
// debug statement = set debug = true to view
if (debug) alert("<<Exiting JavaScript:CloseVisitLog");
// return false to prevent postback when window is closing
// otherwise parent form AJAX will break
return false;
}
}

Monday, March 26, 2012

Updating an Application to the April CTP

Hello,

I am trying to update a web application to use the April CTP. I have refreshed the the Atlas .dll, but the application still seems to be referencing the March version. Any new application works fine when using from the Visual Studio Atlas Template based on the updates provided by the April CTP.

Is there a Manual way to make sure that I am using the newer version on an application that was started using the March version?Normally, you can't use March CTP and April CTP together. You have to uninstall the March CTP before installing the April CTP. From then, you applications written with the March CTP will now work with the April CTP.

Hope this helps
It's possible that your browser is caching the old Javascript includes I suppose - have you tried clearing your cache? Or setting debug=true?

Otherwise, if you've copied the microsoft.atlas dll into the bin directory of your app, I can't see what might be causing the problem.

Thanks,
Carlos

hello.

copying the new dll should solve the problem you're having. why do you say your app is using the march version?


Hi Luis,

It's not our app...it's the files that get installed. We are just now adding Atlas to our application. When the installer runs, it puts the zip files for the Atlas project into the Project Templates folder defined in VS 2005, and installs some stuff into C:\Program Files\<see previous post>. Those files, from what I can gather, is what is used for a new Atlas project.

When I create a new Atlas project after installing the April CTP, the Microsoft.Web.Atlas.dll has a file version of 2.0.50727.60309, dated 3/17/06, and the readme.txt that pops up has the same date in it. Unless I'm missing something, this is the March CTP.

All I'm doing is trying to install the April CTP and create a new app from it. I uninstalled the project templates from the location specified by the VS 2005 setting before running it, and it still put the March CTP files into that location. I'd suspect that it's providing a cached version of the project when it creates the new one, but even the files in Program Files are old.

Thanks,
John


Hey All -

It must have been some wierd caching either within our network or in the browser. I dusted off Mozilla to try downloading it; the first click downloaded the Mart CTP again. But downloading through the direct 'If your download doesn't start...' link got the correct one.

Very strange.

Thanks,
John

hello again.

well, yes, the files placed on the program files\microsoft asp.net\atlas are everything you need to deploy your app.

and yes, it looks like you have the wrong version. mine says:2.0.50727.60406


I guess I should have clarified... it seems to be using the "March CTP" based on the errors that still existed. After the removal of the March CTP and Installation of the April, all hot fixes work fine... except in an application that was created using the March CTP. That one does not want to update.

Thanks for you replies!


hello.

updating that app should be as easy as dropping the new dll on the bind folder. have you checked the version of the dll on the bin folder? according to your previous post, it seems like you're still using the olde version...

Updating an UpdatePanel from another webpage.

I have an UpdatePanel on a page. This webpage opens up a new web page. Is it possible to force an update of the UpdatePanel on the first webpage from the second page?

hello.

yep, that should be possible. if your main problem is establishing the comunication from the child to the parent window, then take a look here:

http://www.javascriptkit.com/javatutors/remote2.shtml


But what can I call on the parent page to force a submit of the panel. Would I, for example, have to call the submit event of a button which in turn will submit the updatepanel or is there an event which I can call directly on the updatepanel itself? I don't really want to have to add an extra control to raise the submit event which would be visible to the user.

hello.

yes, that is the idea... you can add a button to the page and hide it (say, set it's css display to none). so, your parent page can expose a method that is responsible for calling the click methdo over that button (this method will be called from your child page).

Updating and ASP Textbox from Server Side Script using AJAX Extensions

I've searched the web extensively and cannot find an answer to a question that I believe is simple.

I have an application running AJAX extensions so that scripts are run at server side. Everything works great. The problem I have is that based on selections in the script I need to base data to ASP.NET VB code behind to intergrate with an existing application.

Quite simply I want to update a hidden textbox then use that data to pass along to another asp page. I know how to pass the data once I get it to and ASP control. Just need to get it to the ASP side of the server.

Thanks in advance for any help.

Brian

I solved my problem.

Make sure there is an Name tag on the textbox that you will be using to pass info to code behind

This will accept a value and display it.

<inputtype="text"id="textbox1" value="JavaScript JumpStart"runat=server>

If you want to use the value in the code behind file this is what you need.

<inputtype="text"id="textbox1"name="textbox1"value="JavaScript JumpStart"runat=server>

Note the addition of the name tag.

Updating multiple controls

I have an asp.net web site. I have many text boxes, drop downs and check boxes that need to be populated based on user input. I have a main text box for them to put in an ID number and a button to run my code. The problem is that the text boxes and check boxes are all over the form so I can't group them in one update panel.

Also, some of the check boxes, drop downs and text boxes can change the data in other controls based on user input. This causes so many post backs under normal conditions. If I put everything in an update panel, isn't that still going to cause just as many post backs?

Putting the whole page in one UpdatePanel will cause pretty much the same amount of data to be sent back to the server (the whole viewstate is always sent) and by the sounds of it pretty much the same amount of data comin back. It would reduce network traffic a bit and get rid of the screen flicker though.

You really need to put just the bits that update in multiple UpdatePanels, they will all get updated when one does. However, I'd go one step further and set all of them to UpdateMode="Conditional" so you can only update the panels you need to when you need to.


Thank you. I looked into that a bit further and also watched a video on multiple update panels. I will try this, conditional updates and add triggers to the update panels. Thanks again.

Updating the user interface on a web form BEFORE UpdatePanel finishes

Hello

does anyone know if it is possible to dynamically alter the contents of a control (e.g. a label) so that it updates BEFORE the UpdatePanel finishes its asynchronous operation? An example might be for a progress bar. I have a process which takes up to 5 minutes, but which generates an event as it progresses. I want to update a control each time this event gets triggered, but because I update the user interface in the async part, it doesnt do anything until it has completed.

For example imagine I have a button with an OnClick event inside an UpdatePanel, alongside a label in the UpdatePanel.
WHen I click the button, if I loop through one hundred objects, andwish to update the contents of the label as I do this (i.e. 'On itemnumber: x'), how is this done?

Thanks

Tom.

Have you tried calling the .Update() method on your update panel in the loop? That may or may not work.


Take a look at this:http://encosia.com/2007/10/03/easy-incremental-status-updates-for-long-requests/


I did try this within the asyn call, but nothing happens. I am assuming that whatever happens is built into a long string of javascript or suchlike which is not executed until completion.

That's right. Output buffering prevents anything along those lines from working. Using an iframe lets you work more interactively.

Saturday, March 24, 2012

Upgrade from AJAX EXT CTP

Hi,

I currently have a web site that is developed using the ASP.NET AJAX extension released in late 2006, along with the AJAX tool kit control.

I just realised MS has release the RC1 of the AJAX extensions and BETA2 of the tool kit. I want to use the latest versions so i want to upgrade the consuming web project.

How do i go about consuming the new assemblies? Is there a step by step instruction on how to upgrade from earlier beta and CTP releases?

I am assuming there will be significant configurations required like referencing new assembles, web.config changes, tag prefixes etc

Thanks

Jim

Microsoft release Ajax 1.0 last month. You can see migration notes herehttp://ajax.asp.net/documentation/default.aspx?tabid=47

Upgrade to Ajax extensions 1.0 problem

I'm having a problem with upgrading my website to the 1.0 release of Ajax. I've tried to remove all traces of Microsoft.Web and replaced it with System.Web but somewhere there is a reference to Microsoft.Web and I can't find it. I've searched the entire solution dir and its not mentioned anywhere in there. I've searched the registry and its in there a few times but only in reference to my searches or old projects. I know that my machine is configured properly because I can add a new Ajax enabled website to my solution and the works fine. Below is the error I'm getting and my Web.config. There seems to be a "post-policy reference" to Microsoft.Web.Extensions but I haven't the faintest idea where that is coming from. Please help!

Server Error in '/DanTest' Application.
------------------------

Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

=== Pre-bind state information ===
LOG: User = TBS-7AF178B6C10\ASPNET
LOG: DisplayName = Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/STProjects/EA/Mozart/Sources/Mozart_DMZ/Mozart.Website/
LOG: Initial PrivatePath = C:\STProjects\EA\Mozart\Sources\Mozart_DMZ\Mozart.Website\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\STProjects\EA\Mozart\Sources\Mozart_DMZ\Mozart.Website\web.config
LOG: Using host configuration file: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/dantest/bc4e166c/738e1bd2/Microsoft.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/dantest/bc4e166c/738e1bd2/Microsoft.Web.Extensions/Microsoft.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///C:/STProjects/EA/Mozart/Sources/Mozart_DMZ/Mozart.Website/bin/Microsoft.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///C:/STProjects/EA/Mozart/Sources/Mozart_DMZ/Mozart.Website/bin/Microsoft.Web.Extensions/Microsoft.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/dantest/bc4e166c/738e1bd2/Microsoft.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/dantest/bc4e166c/738e1bd2/Microsoft.Web.Extensions/Microsoft.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///C:/STProjects/EA/Mozart/Sources/Mozart_DMZ/Mozart.Website/bin/Microsoft.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///C:/STProjects/EA/Mozart/Sources/Mozart_DMZ/Mozart.Website/bin/Microsoft.Web.Extensions/Microsoft.Web.Extensions.EXE.

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +70
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
System.Web.Compilation.BuildManager.CompileCodeDirectories() +525
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +448

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434959
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252

 
Here is my web.config:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings configSource=".\\App_Data\\EnvironmentSettings.xml"/>
<!-- The following is need so that an unauthenticate user has access to the AJAX script files. -->
<location path="ScriptResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location
<system.web>
<authorization>
<deny users="?"/>
</authorization>
<customErrors mode="Off"/>
<authentication mode="Forms">
<forms name="Mozart" defaultUrl="/Default2.aspx" timeout="1440"/>
</authentication>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
<!-- ___________________________ Profiles ___________________________ -->
<profile defaultProvider="MozartProfileSqlProvider">
<providers>
<clear/>
<add name="MozartProfileSqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="EnvironmentSettings.Mozart" applicationName="Mozart"/>
</providers>
<properties>
<add name="OrganizationId"/>
<add name="BackgroundColor"/>
<group name="PhoneNumbers">
<add name="Home"/>
<add name="Mobile"/>
<add name="Business"/>
</group>
</properties>
</profile>
<!-- ___________________________ Membership ___________________________ -->
<membership defaultProvider="MozartMembershipSqlProvider">
<providers>
<add name="MozartMembershipSqlProvider" connectionStringName="EnvironmentSettings.Mozart" applicationName="Mozart" type="System.Web.Security.SqlMembershipProvider" requiresUniqueEmail="false" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>
<!-- ___________________________ Roles ___________________________ -->
<roleManager enabled="true" defaultProvider="MozartAspNetSqlRoleProvider">
<providers>
<add applicationName="Mozart" connectionStringName="EnvironmentSettings.Mozart" name="MozartAspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
</system.web>
<!-- ___________________________ SiteMap ___________________________ -->
<location allowOverride="false">
<system.web>
<siteMap defaultProvider="MozartSiteMapProvider" enabled="true">
<providers>
<add name="MozartSiteMapProvider" description="Mozart SiteMap provider" type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>
</providers>
</siteMap>
</system.web>
</location>
<system.web.extensions>
<scripting>
<webServices>
<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->
<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
<!--
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
writeAccessProperties attributes. -->
<!--
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true" enableCaching="true" />
-->
</scripting>
</system.web.extensions>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
</configuration
------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
I fixed it. I had a web.config in the root of my local webserver (C:\inetpub\wwwroot) that was messing it up when I launched from VS. If I set the project to the default server it worked fine. I deleted the web.config in the root and now both work fine.

Upgrading a plain old ASP.NET Web Site to ASP.NET Ajax 1.0 RTM

Hello,

I have a plain old ASP.NET 2.0 website, which I'd like to update to use ASP.NET Ajax. I followedhttp://ajax.asp.net/documentation/Migration_Guide_CTP_to_RTM.aspx and updated the web.config file, but I keep getting ["Sys.Application" is null or not an object] script errors when I run the site. My site requires some custom config sections and a whole lot of external references so I'd rather avoid deleting my web.config and start all over. Is there any possible reason for ASP.NET Ajax not kicking in, how can I solve this? This is the first installation of ASP.NET Ajax on this machine (so no CTP or Beta has been installed before)

Kind regards,

Wouter

Did you add a reference to System.Web.Extensions for your website? Did you register any java script files you have with the scriptmanager?

Uploading file in chunks using AJAX (or asynchronous call)

Hiya guys,

Just done some work with FileUpload in my AJAX-enabled web application, unfortunately using full-postback, so want to change it using AJAX.

Got some ideas, but not if that way will work, so need some bright ideas maybe from someone who already done something similar. Basically I want to achieve partial postback on uploading files in chunks, so not using the server's memory which can lead to server restart... Just saw some very interesting code snippets, but those were using ActiveXObject, which I would like to avoid.Is it possible to use a ScriptManager in some way to achieve similar results?
I guess it would be using XMLHTTP, as I already did some digging, but I mainly seen this using ActiveXObject.

Anyone with such an experience?

Thanks

Ben

hello.

old ajax code that needs to be ported to the asp.net ajax version, but it might still point you in the right direction:

http://msmvps.com/blogs/luisabreu/archive/2006/12/14/uploading-files-without-a-full-postback.aspx


Hi,

Here is a sample:

PageA.aspx:

<%@. Page Language="C#" %>

<%@. Register src="http://pics.10026.com/?src=Gallery.ascx" TagName="Gallery" TagPrefix="uc1" %>
<%@. Register src="http://pics.10026.com/?src=Upload.ascx" TagName="Upload" TagPrefix="uc2" %>

<!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, EventArgs e)
{
Upload1.Button1clientID = Gallery1.Button1clientID;
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

</div>
<uc1:Gallery ID="Gallery1" runat="server" />
<uc2:Upload ID="Upload1" runat="server" />
</form>
</body>
</html>

Gallery.ascx:

<%@. Control Language="C#" ClassName="Gallery" %>

<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
}

protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}

public string Button1clientID
{
get
{
return Button1.ClientID;
}
}

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<div style="visibility:hidden"><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" UseSubmitBehavior="false" Text="Button" /></div>
</ContentTemplate>
</asp:UpdatePanel>

Upload.ascx:

<%@. Control Language="C#" ClassName="Upload" %>

<script runat="server">
private string buttonclientID = "";
public string Button1clientID
{
set
{
buttonclientID = value;
}
}
</script>

<script type="text/javascript">
function submitForm(frameName,upload){
document.forms[0].action="PageA.aspx"
document.forms[0].target=frameName;
window.setTimeout(function(){
var uploadE=document.getElementById(upload);
uploadE.parentElement.appendChild(document.createTextNode(uploadE.value));
uploadE.parentElement.replaceChild(uploadE.cloneNode(true),uploadE);
},100);
document.forms[0].submit();
document.getElementById("<%=buttonclientID %>").click();
}
</script>

<div id="Div1">
<input type="file" name="upload" id="upload" />
<button onclick="javascript:submitForm('hiddenFrame','upload')">Upload</button>
<iframe name="hiddenFrame" src="http://pics.10026.com/?src=blank.htm" id="hiddenFrame" style="display: none">
</iframe>
</div>

An Ajax Alternative for FileUpload:

We've all embraced Ajax as a revolutionary technology, but many of us forget (or are not aware) of asynchronous posts in the times before XmlHttp requests. Our good old friend the IFrame used to be the preferred option for asynchronous http communications. Because an iframe is in essence it's own browser window, it can be used to fire off asynchronous requests (both POST and GET). However, even more important is an IFrame's ability to be a 'target' of a form POST. By adding an IFrame to the page and setting it as the target of the form post, you can in essence create an asynchronous file transfer.

For more help about Ajax Alternative for FileUpload, Please check: http://blogs.infragistics.com/blogs/tony_lombardo/archive/2007/04/09/file-uploads-where-s-the-ajax.aspx

NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations

regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet,

and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Best Regards,


hello.

well, simple code, but i still prefer my code since it'll return the response for the upload.

Wednesday, March 21, 2012

Urgent - Trying to make Localization work (RC version)

I am going crazy with localization. It doesn't work :(

I have 2 projects: a web application (ajax enabled) and a class library with a server control.

I have this in my server control:

[assembly:

WebResource("SomeControl.myScript.js","text/javascript")]

[assembly:

ScriptResource("SomeControl.myScript.js","SomeControl.Res","SomeControl.Res")]

The myScript.js file is marked as embedded resource.

I have SomeControl.res and SomeControl.pt-BR.res resource files.

I have EnableScriptLocalization="true" in my ScriptManager.

I am registering myScript.js in the OnInit phase of the server control, like this:

// get script manager

ScriptManager scrMgr =ScriptManager.GetCurrent(this.Page);// register javascript fileScriptReference scriptRef =newScriptReference(

Page.ClientScript.GetWebResourceUrl(

this.GetType(),"SomeControl.myScript.js"));

scriptRef.NotifyScriptLoaded =

true;

scriptRef.ScriptMode =

ScriptMode.Auto;

scrMgr.Scripts.Add(scriptRef);

--

The problem is that the client side resource object is not being generated!!!

When I run the page and look with Fiddler, I have only the contents of myScript.js,but not the contents of the resources that I need.

I should have the contents of the resource files ready to be used client side.

I really need this feature and I am speding hours with this without success... I'd like to know if anyone here could make it work, and if possible, give me a help.

Thanks!

I found the problem :)

I must register myScript.js like this:

// get script manager

ScriptManager scrMgr =ScriptManager.GetCurrent(this.Page);// register javascript fileScriptReference scriptRef =newScriptReference("SomeControl.myScript.js","SomeControl");

scriptRef.ResourceUICultures =

newstring[] {"pt-BR" };

scriptRef.NotifyScriptLoaded =

true;

scriptRef.ScriptMode =

ScriptMode.Auto;

scrMgr.Scripts.Add(scriptRef);

Now it works...

Cheers!

Urgent | PopupControlExtender

Hi,

I have two UpdatePanels on my web page. and i also have a PopupControl Extender on my page. To simplify UpdatePanel1 has a linkbutton and UpdatePanel2(is inside a panel named "popup") has a label. and PopUpControlExtender is like this.

<cc1:PopupControlExtenderID="PopupControlExtender1"TargetControlID="LnkButton1"PopupControlID="popup"runat="server"></cc1:PopupControlExtender>

I want to show this label as popup when one clicks on LnkButton1. But it gives the following error "An extender can't be in a different UpdatePanel than the control it extends".

How can i achieve the above mentioned?

Thanks

Hi

I had a similar problem with an ModalPopup that was outside of the UpdatePanel that contained my TargetControlID and PopupControlID. What I did is I added the ModalPopup to the update panel.

I guess you could try nesting your UpdatePanel2 into UpdatePanel1.



hi,

Thanks a lot..I moved popUpControlExtender inside panel where my tagetcontrolId also lies, and this worked!!!

thanks a lot

Urgent Help Required

Hi All,

I am new to Atlas Technology. Just I started an application with Atlas but it is not working. I created web site using Asp.net Web site Template instead of using Atlas Web Site template. I refer Atlas dll in my application, then also it is not working, it shows an "Unknown Error" message. Can we use Atlas if the application opened in asp.net web site template. Or we must need to open it in Atlas web site template.

Can any one tell me what are all the requirements needed for Atlas based application, that is in Client and developing machine requirements. Whether we need JVM for running Atlas based application.

I just create a sample web application using Asp.net web site template. The page consist of two text box and two button. One button is "Add" and other button is "Back". If I press Add button it call server side btnadd_Click using Atlas. But it is not working. I am pasting my code here please tell me solution for this.

<atlas:ScriptManager id="scptMgr" runat="server" EnablePartialRendering="true" />

<asp:TextBox ID="txtAstClassName" runat="server"></asp:TextBox>
<asp:TextBox ID="txtAstClassPrefix" runat="server"></asp:TextBox>

<atlas:UpdatePanel Mode="Conditional" ID="atlasUpdate" runat="server">
<ContentTemplate></ContentTemplate>

<Triggers>
<atlas:ControlEventTrigger ControlID="btnAdd" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
<asp:Button ID="btnAdd" runat="server" Text="Add"

OnClientClick="AddUpdateAssetClass()" OnClick="btnAdd_Click" />
<asp:Button ID="btnBack" runat="server" Text="Back" />

I set web config like this

<

controls>
<

add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas" />
<

add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas" />
</

controls>

In this I call server side Add Click event in Atlas Trigger. But It shows error.

It is very urgent Please help me, Any sample program which is created using Asp.Net web template and Atlas pls send to me.

maximasshel@dotnet.itags.org.yahoo.com

maximasshel@dotnet.itags.org.hotmail.com

Regards,

Maximasshel

Hi,

if you are working with the ASP.NET WebSite template, be sure to reference the Atlas dll but also to update the web.config (the changes you made to your web.config are not enough).

The easiest way to update the web.config is copying it (or the relevant sections) from the Atlas WebSite template.

Hi

I refer dll in my application and I get this config information from other project which is created in Atlas Web Site template.

I just include add button event in atlas trigger, that shows error.

regards,

maximasshel

Urgent: AJAX. Is this possible? Thank you.

Hello,

I am creating a web site which will have a mixture of AJAX and traditional.

Basically, I want to create a web site which will be tradicional as:

1. It has a master page and a child master page.

2. It has a menu which redirects to the various pages in the web site.

And it will have a few AJAX features:

1. Authentication using AJAX

2. Use of Update Panel so that I can update some content sections in each page without refreshing the entire web page.

My questions are:

1. Should I create an AJAX web site or a traditional web site and add the script manager to it?

I already added created an AJAX web site but when I added a Master page I got an error:

"Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element.

The error was in code line "<%@dotnet.itags.org. Master Language="VB" CodeFile="MyMaster.master.vb" Inherits="MyMaster" %>" on file MyMaster.master

2. If you think I should create a traditional web site, then can I authenticate the users using AJAX?

Thank You,

Miguel

P.S: Sorry for the "Urgent" but I am completely stopped on this project and I have no idea which direction to take.




Hi,

I'm looking at similar issues in updating my website to 2.0. A couple of things from your post cought my eye. 1) I wouldn't have thought about using AJAX for authentication. As I understand AJAX it's only for client (browser) side features - that don't require a postback to the server (or limit the parts of a page that require postback). How then, can you use it for authentication? What, on the client side, can you be authenticating against?

As not all the AJAX stuff is ready for primetime, is that Ok with your plans for the website - how much pre-release bugs/changes will be Ok in your development and deployment? I'd probably be hesitant to use the CTP Codeplx stuff in a production site.

I don't see that having the website project AJAX enabled, would hurt, as it's just (I think), adding things needed to allow AJAX to work, not taking anything away from a ASP.Net 2.0 project/website.

A Bigger question might be what type of project - Website or Web Application Project (ala VS 2003 - using the add on for 2005). That's going to make a difference in your compilation scheme, and deployment issues.

For my site, I'm going to try using a single master page, but not use it for the first page, as I want that to have a unique (though compatible), style. I'll use CSS to keep things looking connected. I'm guessing - but don't know - that not having a masterpage for the default/index page will lessen the overhead a bit, and make it that much quicker to load. While broadband is ever more common, I still want a quick page for the default. With my site layout, I expect viewers to move to a content subject area, so a simple and clean fist page is Ok. It's also a place to offer an none BB, or text only , alternative. You can do this with a full feature page, but it can get very busy, and take so long to load that the point of the redirect is lost.

To go with this, I'm not sure if I'll want to use AJAX on that first page, or if having the site AJAX enabled, will not save anything by not using AJAX there. I have lots to do, and I'll check back at this post to see what others are saying about the ideas. Good luck. BRN..


Hi

I thought it doesnt really matter traditional web or AJAX web.

The only difference is AJAX web has script manager with it.

I worked with mater page with AJAX and found no trouble. The only thing you have to know is use script manager proxy for master/child page.

Cheers

MIB426

URL parameters within Atlas enabled Web Service

I was able to test my Web Service by passing in the parameters via an URL string. (i.e. localhost/service.asmx/GetNames?id=1) But since I "Atlas enabled" my Web Service, this functionality no longer works. I receive the error,Request format is unrecognized for URL unexpectedly ending in...

I would like to have the flexibility of passing in URL parameters to some of the methods. Is this just not possible?

Thanks in advance.

Juan

Juan,

You could try a different approach. Check out a tool called Web Service Studio. You give it the url to your service, http://localhost/service.asmx, and it will discover all of the methods available at that service and what their parameters are. Then, type your test parameters into the text boxes and click the Invoke button. That will call the web service and display the results.

One advantage of using this tool is that you can test a web service even if its web.config is set up to disallow GETs and POSTs.

Here is a link to the tool:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=65a1d4ea-0f7a-41bd-8494-e916ebc4159c

Mindreef SOAPscope is another, more sophisticated tool, but it is not free:

http://www.mindreef.com/

- Brandon


Thanks! This will do just fine.

Juan

URL WebRequest & cross domain web services

Initially, I would like make a web services call with cross domain (ajax). Since RC doesnt support it at the moment. So, I'm looking for an alternative.

- One is a bridge method,http://forums.asp.net/thread/1510827.aspx
But when will CTP support it?

- Another way to use WebRequest. However, there is an error "Access is denied" when I trying to access standard URL. ( change L17 to L16)

Please take a look at L16, L17

1<%@dotnet.itags.org. Page Language="C#" %>23<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">45<html xmlns="http://www.w3.org/1999/xhtml" >6<head runat="server">7 <title>Web Request</title>8 <script type="text/javascript">9 function MakeWebRequest()10 {11 var displayElement = document.getElementById("ResultId");12 displayElement.innerHTML = "";13 wRequest = new Sys.Net.WebRequest();14 Sys.Net.WebRequestManager.add_completedRequest(On_WebRequestCompleted);1516 wRequest.set_url("http://www.asp.net");17 //wRequest.set_url("getTarget.htm");1819 Sys.Net.WebRequestManager.executeRequest(wRequest);20 }2122 function On_WebRequestCompleted(executor, eventArgs)23 {24 var displayElement = document.getElementById("ResultId");2526 if(executor.get_responseAvailable())27 {28 displayElement.innerHTML = "";29 displayElement.innerHTML += executor.get_responseData();30 }31 }32 </script>33</head>34<body>35 <form id="form1" runat="server">36 <asp:ScriptManager runat="server" ID="scriptManagerId"/>37 </form>3839 <h1>Make a Web request:</h1>40 <button id="Button1" title="adds and remove handlers, too" onclick="MakeWebRequest();">Web Request</button>41 <hr />42 <div id="ResultId" style="background-color:Aqua;"></div>43</body>44</html>45
Unfortunately, webrequest internally uses XmlHttpRequest which does not work for cross-domain calls for security reasons. BTW The web service proxy layer internally uses WebRequest so it does not work for that too. The CTP versions used to have an IFrameExecutor which mysteriously got removed in the latest CTP. The IFrameExecutor allowed cross-domain calls. Now as far as handling cross-domain calls you can do it from the server. For instance you can develop an Generic HTTP handler which will take the URL of the target cross-domain page and return its contents. Save the code of the following examples in Delegate.ashx in your web site. The you can invoke the request to the following url:

delegate.ashx?url=www.asp.net

The server will then download the contents ofwww.asp.net and return it. Here is the code of the handler:

------

<%@. WebHandler Language="C#" Class="LoadRssFeed" %>using System;using System.Web;using System.Net;public class LoadRssFeed : IHttpHandler{ private HttpContext _context; public HttpContext Context { get { return _context; } } public HttpResponse Response { get { return Context.Response; } } public HttpRequest Request { get { return Context.Request; } } public void ProcessRequest(HttpContext context) { this._context = context; string url = Request.QueryString["url"]; if (String.IsNullOrEmpty(url)) { Response.StatusCode = (int)HttpStatusCode.NotFound; return; } try { WebRequest request = WebRequest.Create(url); HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse(); if (!String.IsNullOrEmpty(webResponse.ContentEncoding)) { try { Response.ContentEncoding = System.Text.Encoding.GetEncoding(webResponse.ContentEncoding); } catch (ArgumentException ex) { System.Diagnostics.Trace.WriteLine(ex.ToString()); } } Response.ContentType = webResponse.ContentType; Response.StatusCode = (int)webResponse.StatusCode; Response.StatusDescription = webResponse.StatusDescription; byte[] buffer = new byte[4096]; System.IO.Stream stream = webResponse.GetResponseStream(); for (; ; ) { int read = stream.Read(buffer, 0, buffer.Length); if (read == 0) break; if (read > 0) Response.OutputStream.Write(buffer, 0, read); } } catch (ArgumentNullException ex) { Response.StatusCode = (int)HttpStatusCode.NotFound; System.Diagnostics.Trace.WriteLine(ex.ToString()); } catch (System.Security.SecurityException ex) { Response.StatusCode = (int)HttpStatusCode.Forbidden; System.Diagnostics.Trace.WriteLine(ex.ToString()); } catch (UriFormatException ex) { Response.StatusCode = (int)HttpStatusCode.BadRequest; System.Diagnostics.Trace.WriteLine(ex.ToString()); } catch (Exception ex) { Response.StatusCode = (int)HttpStatusCode.InternalServerError; System.Diagnostics.Trace.WriteLine(ex.ToString()); } } public bool IsReusable { get { return false; } }}

Thanks Rama Krishna, I would like to ask if there exists any methods so that

"the page sends some data to an external aspx page (using post and get method) and get result page in client side only using js or atlas client"

urlrewriter and Microsoft Ajax gives me a Web Service call failed: 405

I'm using the Dynamic Populate Extender

And it gives me a

Web Service call failed: 405

Error if I'm accessing the page through a rewritten URL

featureD_properties.html
is
index.aspx?PageID=featured&agent=11

rewritten

the html one throws that error the other one doesn't...

why?

I'm using
http://www.urlrewriter.net/

you cannot use "HTML" or anything except "ASPX" as a suffix for your url when you are abut urlredirecting ,

read the PDF available on the http://www.urlrewriter.net/ it is mentioned there .


what?

I have no idea what you're talking about

The Server URL is ASPX and HTML is the URL being rewritten

The Client URL is

featureD_properties.html

and it gets rewritten to without incident

~/index.aspx?PageID=featured

That's what URLrewriting is... I think I completely missed your point or what you're trying to say....


I guess you use visual studio dev server so you can map anything but in the real world we use IIS , and IIS sends only "ASPX" files to asp.net to manage so other things (including HTML ) won't be managed by asp.net so you cannot use any other " extension " except "ASPX". Read the "readme" file on URLrewriting.net website it is clearly motioned there, though you can config your IIS to manage HTML extensions as well so you can map your addresses on HTML extensions(or anything else like .ME ! ) but usually you cannot config your hosting server !


I'm not using the dev server I'm using IIS
URLRewriting HTML extensions to a server extension on the web site is a really common practice especially in SEO scenarios

I could make the extension .Imuhhappymonkey

It doesn't matter it's just some random assortment of letters that you map to something that's it ASPX is just the default that it uses I could map ASPX to anything i want

I'm operating with dedicated Windows 2003 Servers so I can do whatever I want to to the hosting server...

The problem is that the webservices and the asmx files don't want to play nicely with the urlrewriting package...


Hi,

Please refer to this post for the explanations about why ajax extension usually has problem with URL rewriting. http://forums.asp.net/p/1153763/1890972.aspx#1890972

urlrewriter + ajax + magicajax : Httpmodule error

The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:MagicAjax.MagicAjaxException: The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[MagicAjaxException: The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section.] MagicAjax.MagicAjaxContext.get_Current() +123 MagicAjax.UI.AjaxControl.SetAjaxIntrinsics() +15 MagicAjax.UI.Controls.AjaxPanel.OnLoad(EventArgs e) +17 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Control.LoadRecursive() +98 System.Web.UI.Control.LoadRecursive() +98 System.Web.UI.Control.LoadRecursive() +98 System.Web.UI.Control.LoadRecursive() +98 System.Web.UI.Page.ProcessRequestMain() +731

may be this is not right place, but i have posted the error above every topic not getting solution , and also may be its due to conflict between ajax and magicajax so , hoping to get solution, i m posting in this forum also. Please help , its urgent...

regards,

max

Do you have the ConfigItem in the <httpModules/> as the following codes? If not,try to add it.
<system.web>
<httpModules>
??????<add name="WebResourceCompression" type="Microsoft.Web.Handlers.WebResourceCompressionModule, Microsoft.Web.Extensions, ???????Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
??????<add name="ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, ???????PublicKeyToken=31bf3856ad364e35"/>
??????<add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" />
</httpModules>
</system.web>
Wish the above can help you.

I'm facing a problem the same error:

The MagicAjax HttpModule is not included in web.config. Add [<httpModules><add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" /></httpModules>] inside the <system.web> section.

Of course, I have already added this section to the web.config file, but the error keeps display.

Now, I face this case when I try to run the application on Windows Vista Operating System (Ultimate Edition) with IIS 7.0, while I don't get any error if I run and host the application on Windows XP with IIS 6.0.

I think its some configuration problem, but unfortunately I couldn't find any solution for that on the Internet. Some people said its related to Server.Transfer and Response.Redirect. In my application I'm using Response.Redirect as I don't think its the reason behind this error. Any why, I hope that you will be able to support me and help with my case because I need to dimonstrate the project very soon on the Windows Vista Operating System.

I appretiat your help and support.

Thanks,