ラベル version の投稿を表示しています。 すべての投稿を表示
ラベル version の投稿を表示しています。 すべての投稿を表示

2012年3月26日月曜日

Response.Redirect not working in RC version

I am trying to use Response.Redirect in the RC version of AJAX but it is returning an error. I have found a similar post to this issue and it discusses Beta2 vs RC references. I have ensured that all of my references are pointing to the System.Web.Extensions for the RC release yet the problem still exists.

Any ideas as to how I can fix this issue? Sorry if this is repeated, I just didn't find a clear response in the other posts.

But, what's the error? Can you post it?

The error is:

Sys.WebForms.PageRequestManagerParserException: The message received from the server could not be parsed... Error parsing near '<!DOCTYPE html PUB'

My code basically performs a Response.Redirect to another page in the site when a certain condition is met. I am using the AJAX Update Panel and various button control triggers that are all working fine.


You can't place Redirect in partial postback.

PageRequestManagerParserException waits for data from UpdatePanels (for example in JSON format, but I'm not sure), but you Redirect gives another data. In you case it like that redirect doing at server and PageRequestManagerParserException gets new page.

You must do redirect with some javascripts.

You have 2 ways:

1) use my evalscripts.js (it extends UpdatePanels, that it can evaluate javascripts, so you can put window.open('xxxyyy.aspx','_top') in some Literal in Label, and it works)

2) use ScriptManager.RegisterClientScript static method. On this forum is very many messages about it. Try to search. (and yes, you also do it throught javascript's window.open)

And of course try to read documentation. Maybe something changed in RC1 and there are some new methods for redirect. I don't know.


Something at you end is not set up well. Check this to make sure everything checks uphttp://ajax.alpascual.com/Walkthrough/AtlasToAspNetAjax.aspx

jriell:

Thanks for the feedback. Where can I obtain your evalscripts.js?

You can download all this from http://ajax.asp.net


Thanks for the feedback. Where can I obtain your evalscripts.js?

Thank You.

As a followup on the problem I had. I did omit something from the web.config of my site. After adding this element to the web.config, the Response.Redirect code that I have started working. It seems as though this functionality does work in the RC version at least.


jriell:

Thank You.

As a followup on the problem I had. I did omit something from the web.config of my site. After adding this element to the web.config, the Response.Redirect code that I have started working. It seems as though this functionality does work in the RC version at least.

Can you say what you add to web.config? Just interesting.

ps. this is work in RC1 ?


albertpascual:

jriell:

Thanks for the feedback. Where can I obtain your evalscripts.js?

You can download all this from http://ajax.asp.net

this is my own script, and there are now way to obtain it from ajax.asp.net , it can be found athttp://forums.asp.net/thread/1465522.aspx

result from web service is what type/object?...

Hi ALL,

At first i was using older version of the AJAX toolkit and the Sys.Net.WebServiceProxy Class was not set. I was getting an error trying to run the posted samples...

Next, i got the latest RC version and updated my toolkit. So far, everything seems to be working great, except the part when the web service result comes back (in the OnSuccess method).

Following the samples, instead of the actual string result i see XML Object. I mean from a simple web method "HellowWorld() as string", instead of a string i see XML Object.

I tried alerting the result.xml, assuming it is of XMLDom object and that is what it is?... Should this be JSON parsed value vs actual XMLDom.

I mean if the webservice returned a stirng, result should be a string, if the web service returned an object with properties A and B, i should be able to access it like this: alert(result.A), and e.t.

Any thoughts will be appreciated!

Ivan

I am sure you all have seen and tried this:

http://ajax.asp.net/docs/Samples/Sys.Net.WebServiceProxy/vb/WebServiceProxy.aspx

In my case, instead of actual server time string for example for example i would see "[object]"...

This object returned is the XMLDom corresponding to the result which i could certainly use and go further with my development, but i am afraid that this may not be the right way. According to the documentation, the result should be the actual object returned from the web service, in this case a string...


You didn't happen to put a ScriptMethod attribute on your web service method to change the ResponseFormat from the default of JSON to XML, did you?

2012年3月24日土曜日

richtexteditor

I noticed is present in development folder version 10917 a control named 'richtexteditor'

is possible to use it? I tried to compile, but the control doesn't work...

There are quite a few rich text editors available for ASP.Net. Check out the following link:

http://geekswithblogs.net/jawad/archive/2005/05/25/CommunityEditor.aspx