Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Wednesday, March 28, 2012

Viewstate - Controls that are there but not there at the same time

Hi All,

I wonder if someone can help. I have just started using ajax and am converting an established application. It uses dynamically created controls to enter parameters for crystal. I have now got a panel that l holds the crystal component, and with testing of directly fed parameters this works fine. As soon as i try and use my dynamic componenets it can't see them. I have gathered this has got something to do with viewstates. I have seen several examples of how to fix this but they are all in C# and the application is in vb. Can anybody step me through this please as i sem to be missing something.

hello,

show me the examples that you found in C# ... i might be able to convert it back to VB for you ... =)


Ttry this online link for converting C# to VB Code...

http://www.kamalpatel.net/ConvertCSharp2VB.aspx


Hi

My conversion is below,

Protected Overrides Function LoadPageStateFromPersistenceMedium()As Object Dim viewStateAs String = Request.Form("__VSTATE")Dim bytesAs Byte() = Convert.FromBase64String(viewState) bytes = Decompress(bytes)Dim formatterAs LosFormatter =New LosFormatterReturn formatter.Deserialize(Convert.ToBase64String(bytes))End Function Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewStateAs Object)Dim formatterAs LosFormatter =New LosFormatterDim writerAs StringWriter =New StringWriter() formatter.Serialize(writer, viewState)Dim viewStateStringAs String = writer.ToString()Dim bytesAs Byte() = Convert.FromBase64String(viewStateString) bytes = Compress(bytes) ScriptManager.RegisterHiddenField(Me,"__VSTATE", Convert.ToBase64String(bytes))End Sub
Public Function Compress(ByVal dataAs Byte())As Byte()Dim outputAs MemoryStream =New MemoryStreamDim gzipAs GZipStream =New GZipStream(output, CompressionMode.Compress,True) gzip.Write(data, 0, data.Length) gzip.Close()Return output.ToArray()End Function Public Function Decompress(ByVal dataAs Byte())As Byte()Dim inputAs MemoryStream =New MemoryStream() input.Write(data, 0, data.Length) input.Position = 0Dim gzipAs GZipStream =New GZipStream(input, CompressionMode.Decompress,True)Dim outputAs MemoryStream =New MemoryStream()Dim buffAs Byte()Dim readAs Integer = -1 read = gzip.Read(buff, 0, buff.Length)While (read > 0) output.Write(buff, 0, read) read = gzip.Read(buff, 0, buff.Length)End While gzip.Close()Return output.ToArray()End Function

And the original code was:

protected override object LoadPageStateFromPersistenceMedium()2 {3string viewState = Request.Form["__VSTATE"];4byte[] bytes = Convert.FromBase64String(viewState);5 bytes = Compressor.Decompress(bytes);6 LosFormatter formatter =new LosFormatter();7return formatter.Deserialize(Convert.ToBase64String(bytes));8 }9protected override void SavePageStateToPersistenceMedium(object viewState)10 {11 LosFormatter formatter =new LosFormatter();12 StringWriter writer =new StringWriter();13 formatter.Serialize(writer, viewState);14string viewStateString = writer.ToString();15byte[] bytes = Convert.FromBase64String(viewStateString);16 bytes = Compressor.Compress(bytes);17 ScriptManager.RegisterHiddenField(this.updVS,"__VSTATE", Convert.ToBase64String(bytes));18 }
thanks again

Monday, March 26, 2012

vista, ajax 1.0 release and web application projects - no intellisense

Hi,

Is anyone else having problems getting intellisense working with the 1.0 release and web appliation projects?

I should add this is on vista and vs2005 sp1 is not installed

Sometimes it seems to be available after switching from design view back to source but not always, also it seems to be worse where a master/child page is used - often when I drop an update panel onto the source its id does not get auto populated? and no intellisense is available?

Any advice welcome

thanks

Richard

You need SP1, and there is another update for vista that you will need. Also, you may need to delete some user data for visual studio.

VS 2005/MS Ajax Beta Application no longer runs on Live server but does in Dev. Help!

I have just migrated from Atlas to MS Ajax Beta and after a lot of hassle to get the application working I decided to publish to our test web server. When I go to the URL for our test server all I get is a blank page but the IE progress bar (the bar at the bottom that show the page loading status) just flickers like crazy. It works fine on my dev machine but as soon as I publish it, no joy!

I really need some help on this as I don't really have a clue and I don't really fancy having to roll back to Atlas just to get this to work live.

Cheers,

FF

Ignore me, I'm stupid!!

I hadn't checked if the extensions were installed on the server!! DOH!!!


hello.

well, you must install ajax extensions on the live server and configure your site to use asp.net 2.0. have you done that already?

Saturday, March 24, 2012

want to use AJAX Control & .....

Hi everyone

I have developed web application without using AJAX.it is completed.

Now, I want to use AJAX functionality & tool kit controls.

SO, what are changes, I have to make in web.config or a particular web page.

Please help me out,

Regards,
ASIF

Hi,

you can take a look at this page:http://asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx or you can create a new website based upon the AJAX web site template and use a tool like winmerge to copy over the needed differences in the web.config file.

Grz, Kris.


How Do I: Add ASP.NET AJAX Features to an Existing Web Application? : The Official Microsoft ASP.NET 2.0 Site

hope it helps./.

Warning: Unable to update auto-refresh reference microsoft.web.atlas.dll

We are 2 developers working on a web application and we started to use ASP.Net Ajax (Atlas). We added the the toolkit and asp.net ajax to the toolbox in visual studio 2005 and we added the 2 dlls to our bin directory in the project. Everytime we move the project from one machine to the other we recieve the following warnings

Warning: Unable to update auto-refresh reference 'microsoft.web.atlas.dll'. Can not find assembly 'D:\ZPrograms3\DotNetFrameworkEnhancements\AspNetAjax (Atlas)\AtlasControlToolkit\SampleWebSite\Bin\Microsoft.Web.Atlas.dll'.

Warning: Unable to update auto-refresh reference 'atlascontroltoolkit.dll'. Can not find assembly 'D:\ZPrograms3\DotNetFrameworkEnhancements\AspNetAjax (Atlas)\AtlasControlToolkit\SampleWebSite\Bin\AtlasControlToolkit.dll'.

Should we put the ASP.Net stuff in a folder on the C: drive in a ASP.Net folder on both machines. What I don;t understand is why we have to do that if we have the dlls in our bin folder in the project. Can anyone clarify?

Newbie

hello

i think this is nothing to worry about. the problem is that VS is trying to get a new dll when you compile and when you've moved the project to another machine, you've just lost that reference (probably you don't have the toolkit on the other machine or it's placed in a different folder). so this shouldn't take your sleep :D


But what is the solution?

Set a new reference?

Way to hold state of collapsible panel?

I've created a website application with a MasterPage that has an Accordion side-menu contained in a Collapsible Panel. It works fine, however, I need a way to hold the state of these controls when the user is redirected to another page.

So, if they have the side-menu collapsed and click a link to another page, when the new page is displayed, the side-menu should remained collapsed...is there anyway to do this? Basically, I just need to set some Session Variables to hold the state whenever the user manipulates the side-menu...

You could probably do it in viewstate? I don't have time to test it out right now, I'll try to get back to this later if nobody else has answered. Basically after you open a collapsible panel you could set something like viewstate("thiscontrolisCollapsed")=false and then on the page load you could do something like

if viewstate("isCollapsed")=false then

' code to open panel

end if

just off the top of my head. Sorry I can't be more technical with it, I'm getting ready to walk out the door and thought I'd throw this out as a suggestion.


Thanks, but the problem is actually being able to hold the state of the collapsible panel on the server side. All the collapsing and expanding is handled in client side javascript, and I'd need to somehow run some server-side code to hold the state after the client script has expanded or collapsed the panel.

I was thinking I need to fire off a client side call-back, but I can't figure out how to trigger it when the collapsible panel is expanded or collapsed...


Ok, I've figured out how to accomplish this. I already had an image that was the ExpandControlID and CollapseControlID, that the user clicks on to expand or collapse the panel. So I simply added an onclick attribute to that image which calls a javascript that initiates a client side call-back, where I pass the Collapsed status of the panel to the server and set a session variable. My code is below:

<script type="text/javascript" >
function holdSideMenuState(){
holdSideMenuStateInSession(!$find("SideMenuBehavior").get_Collapsed());
}

function sessionNowHoldsSideMenuState(isSideMenuCollapsed, context){
alert(isSideMenuCollapsed);
}
</script>
<table border="0" cellpadding="0" cellspacing="0" class="SideMenu">
<tr>
<td class="SideMenuExpandCollapse" valign="top">
<asp:Image ID="imgExpandCollapse" runat="Server" ImageUrl="~/images/collapse.jpg" CssClass="ExpandCollapseImage" />
</td>
<td>
<asp:Panel ID="pnlSideMenu" runat="Server">
Side Menu Content goes here....
</asp:Panel>
</td>
</tr>
</table
<ajaxToolkit:CollapsiblePanelExtender ID="cpeSideMenu" runat="server"
TargetControlID="pnlSideMenu"
CollapsedSize="0"
Collapsed="False"
ExpandControlID="imgExpandCollapse"
CollapseControlID="imgExpandCollapse"
AutoCollapse="False"
AutoExpand="False"
ScrollContents="False"
ImageControlID="imgExpandCollapse"
ExpandedImage="~/images/collapse.jpg"
CollapsedImage="~/images/expand.jpg"
ExpandDirection="Horizontal"
BehaviorID="SideMenuBehavior">
</ajaxToolkit:CollapsiblePanelExtender>


protected void Page_Load(object sender, EventArgs e)
{
string callBackReference = Page.ClientScript.GetCallbackEventReference(this,"isSideMenuCollapsed","sessionNowHoldsSideMenuState","context");
string callBackScript ="function holdSideMenuStateInSession(isSideMenuCollapsed, context){" + callBackReference +"}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"holdSideMenuStateInSession", callBackScript,true);

imgExpandCollapse.Attributes["onclick"] +="holdSideMenuState();";

if (!IsPostBack)
{
if (Session["IsSideMenuCollapsed"] ==null) Session["IsSideMenuCollapsed"] =false;

cpeMenu.Collapsed = Convert.ToBoolean(Session["IsSideMenuCollapsed"]);
}
}

public void RaiseCallbackEvent(string isSideMenuCollapsed)
{
Session["IsSideMenuCollapsed"] = isSideMenuCollapsed;
}

public string GetCallbackResult()
{
return Session["IsSideMenuCollapsed"].ToString();
}


I have some more work to do because in my real code, I actually have an Accordion inside the collapsible panel, and I need to hold the state of the accordion as well, but I'll save any questions I have with that for another thread...

WCF ASP.NET Service not working - what am I missing

Hello. This is a simple question, so please take a look.

I am using Orcas Beta2 and I created a new Solution. In there added a Web Application Project. In the project I created an Ajax enabled WCF service. When I call the service from JavaScript I get this error: Service1 is not defined. What am I missing? Here is the very simple code. Thanks!

default.aspx:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %
<!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>Untitled Page</title>
<script type="text/javascript">
function Hello() {
WebApplication1.Service1.HelloWorld(onComplete, onTimeout);
}
function onComplete(result) {
alert(result);
}
function onTimeout(result) {
alert("Timed out!");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<input type="button" value="Call Hello" onclick="Hello()" />
</div>
</form>
</body>
</html>

namespace WebApplication1
{
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service1
{
// Add [WebGet] attribute to use HTTP GET
[OperationContract]
public string HelloWorld()
{
return "helooo";
}
}
}

code for the service:

namespace WebApplication1
{
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service1
{
// Add [WebGet] attribute to use HTTP GET
[OperationContract]
public string HelloWorld()
{
return "helooo";
}
}
}

web.config (this is generated by VS2008 and i did not modify it):

<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/warnaserror-" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.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=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.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=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="WebApplication1.Service1AspNetAjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="WebApplication1.Service1">
<endpoint address="" behaviorConfiguration="WebApplication1.Service1AspNetAjaxBehavior" binding="webHttpBinding" contract="WebApplication1.Service1"/>
</service>
</services>
</system.serviceModel>
</configuration>

Thanks!

Checkout the following post:
http://odetocode.com/Blogs/scott/archive/2007/07/30/11171.aspx


Yep, I'm guessing this is what you're missing. Afraid you can't get away with just .html as the client. You'll have to create an .aspx page.

Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>


Thanks Kazi,

I tried this and ran into other problems. See http://forums.asp.net/p/1170276/1956960.aspx#1956960

I thought that the default out of the box experience should be easy. It seems that it is not and one needs to fully understand te WCF model before getting anything to work. And WCF is a big monster to learn just to expose a simple REST service.


Jonathan,

Sorry for cutting and pasting only part of the aspx file. i updated the post and included all of the aspx file. Yes, i am using an aspx file and not an html file. Otherwise it would not compile. I tried adding the Factory to the svc file but it did not work for other reasons. It would be nice if someone, (hello Microsoft! :)) would post steps to create a simple service and how to consume it via an aspx page. This was dead simple in asmx, but wcf has just too many knobs and it seems that detailed knowledge of wcf is required to get this to work.


Thanks!

Wednesday, March 21, 2012

web application project and ajax

Hi, Sorry am a little confused about the whole thing, but do I need to create a ajax enabled web site to use ajax? What about a web application projects? The reason I ask is the project is already created but I would like to implement some ajax functionality into it.

If this is possible, what do I need to do?

Thanks in advance

Hi there!

After installing Microsoft's Ajax you'll find a new project template "ASP.Net AJAX Enabled Web Application". It differs from the "ASP.Net Web Application" template in some Web.config entries (e.g. it registers assemblies, asynchronous handlers, and a web module), a new Default.aspx template (with a ScriptManager on the page) and a project assembly reference. To Ajax-enable an existing web application project just duplicate these entries in your Web.config and reference System.Web.Extensions.

There happened to be a FAQ entry on the official Atlas/Ajax site dealing with this in detail, but I can't find it at the moment...

HTH and best regards,
Thomas


Hi,

Thank you for your post!

There is some detail information at theofficial MS ASP.Net AJAX site:

Installing ASP.NET AJAX

Web File Browser in ASP.NET

Hi Guys,

I'm developing a Web Application using ASP.Net 2.0. I have a requirement that the application

should include a file browser just alike the windows explorer that we have. Is there any free tools

or controls available for that.

thanks in advance............

Yenkay

I did a quick search and foundhttp://www.awsystems.biz/2003/products/FilePicker/. I have never used it on a site myself, but I tried their online demo and it seems to be quite good. It didn't have the treeview part, that the windows explorer has, but adding a TreeView is easy and hopefully you can control the FilePickers current catalog easily, so that shouldn't pose a problem.

Web Service Call

Hi,
Is it possible, with atlas, to call a web service that is out-side my application domain
ex. http://sample.com/sample.asmx
ThanksThe issue with doing this is that you will run into the browser's cross domain scripting restrictions. But if the other domain is trusted, and XMLHTTP doesn't block the call, then I believe it should work. Note that for this to work, the web server that processes the request (i.e. that has sample.asmx) needs to also be running Atlas.

It's not possible to use the web server associated with the domain like a "proxy" to call other web service outside the trusted domain? It's just an idea and I think that an automated proxy generator for remote web service can be very usefull. In addiction in this way the remote web service doesn't need to run Atlas.

Web service call from javascript and SQL Server 2005 Express

Hi,

I'm developing a web application that uses Ajax to call web services using javascript.

The web service must connect to a SQL Server 2005 Database (express edition) and uses a dynamically created connection. The connection string used to create the connection is right because it works for web page data loading and it uses SQL server authentication mode.

In the development environment the application works correctly, but when deployed on a different machine with a different SQL Server installation, the sql connection in the web service fails returning the following error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

I've tried all suggested changes in SQL Server Configuration Manager andSQL Server Surface Area Configuration, enabling both tcp/ip and named pipes for remote connection, but the connection is still not working.

The server has a windows XP professional SP2 operating system and windows firewall is active, but i have enabled http from lan and sql server access.

Can you suggest me something?

I must add or change something in the web.config file?

I feel?that this problem is in the permissions connecting Web?Service?to?SQL?Server?2005.I give you some suggestions for your reference as the following:
Try to add Network Service in the virtual directory permissions of IIS and make sure the execute permissions is Scripts and Executables through?right mouse clicking the virtual directory?and?choosing?properties?in?IIS.

Web Service calls .NET 2.0

I have an ASP.NET application in .NET 1.1 that makes a web service call using the Begin{WebMethod} call and then returns to the page and redirects to another page. The Async callback is returned later when this is done and I log any errors that this web method call may have had to the event log. The web page does not wait for the response because it's role is to fire it off and then go on. I am trying to move to .NET 2.0 and have an issue where the Async call for 2.0 will not allow me to redirect until the web service has completed. I do not need a response from my web service and would like to move on to another web page. I basically have switched to making this a synchronous call as how 2.0 is handling it is synchronous.

Thanks for any and all help.

Hello Mladinichs,

check out the Ajax video that shows how to use client side Async call back.

http://www.asp.net/learn/ajax-videos/video-79.aspx

I hope it helps.


Client side is not really what I'm looking for. The button click is gathering up info from the screen, performing a save operation and then kicking off an async process. Any thoughts?


Hi,

If your wanting to do this on the client side, does this work?

function DoSave(){

YourSavingService.SaveData()

document.location.href = "yourNextURL.aspx"

}

Cheers Si


This application is an existing application in production and I'd rather not re-write this entire functionality to be client-side. Is there no way to do this server-side?


Hi,

I suggest using a separate thread to run the task which is currently running on the main thread of the web service that halts it form return soon.

For instance, say your web service is like this now:

void fun() { doSomething(); }

change it to:

void fun() {Thread thrd = new Thread(new thredInfo(doSomeThing); thrd.Start(); }