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

2012年3月28日水曜日

requirePermission="false" in the web.config return warning.

I have unstalled AJAX rc 1 and I get the following warning(4 times), from my web project web.config, after compilation:

"The 'requirePermission' attribute is not declared"

How can I get rid of this warning ?

It comes from this section:

<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"/>
<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"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>

Hi leeorc

pleas review link below

http://forums.asp.net/thread/1204349.aspx

hope it helps you


Ok I took the following advice:

You can workaround it by opening "c:\Program Files\Microsoft Visual Studio 8\XML\Schemas\dotnetconfig.xsd" and inserting the following at line 40:

"<xs:attribute name="requirePermission" type="boolean_type" use="optional" />"

-------------------------------

Despite the fact that one person didnt recommend it, the workaroundhelpedme with non harmful ireversable issues.

Thanks

Leeor


I found that in the string "<xs:attribute name="requirePermission" type="boolean_type" use="optional" />", the type should be Type, I mean the t should be upper cased.

Liang

2012年3月26日月曜日

Response.Redirect in Asp.net AJAX

Hi All,

I Developed a project in as.net with Asp.net Ajax... i used Response.Redirect several time in my web project with and without script manager... and its worked fine...
but some tells me...this is not recommended to use Response.Redirect in asp.net AJAX....and when i will deploy on Production server... there may be chance of some error.............

So please give your opinon....
Thanks
SajjadPerhaps you are confusing this with Server.Transfer. There should be no issues with Response.Redirect.
R u 100% sure...
and what issue with Server.Transfer....

REsponse.Redirec will not cause any issues if you invoke it from CodeBehind pages.

I have worked with one developer who instantiated the Page object, and tried to use the page object.REsponse.REdirect() and that failed - as it should.


response.write and ajax problem

how can i use response.write with ajax?

i made a project and diceded to add ajax to it

but it uses response.write to return <%functionname()%>

but i get an error when i do this and i looked around and found that ajax has a problem with response.write

is there a way around it?

P.S my error :

"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be

paresed. Common causes for this error are when response is modified by calls to Response.Write(),response

filters, HttpModules, or server trace is enabled."

i get this when i postback(first load kk but (i use alot of response.write in the ajaxpanel controls and outside(non ajax controls witch get there vaules from <%myfunction()%> but these values don't change when an ajaxpanle controls post)

anything i can do?

P.S pressing the button works , it's the response that ajax can't understand (when i press the ajax button (witch updates a static int) i get an error but when i press any normal control (and get postback) i get the new static int , so the ajax controled posted.

thanks

Don't know if this is going to answer all your questions, however I had no problem with Ajax and Response.Write ... yet, however won't update if you don't ad a UpdatePanel. Also trace and ajax work together but you may see some div problems between the trace data and the web form when it renders.

Hope this helps a little


hello.

you shouldn't use response.write in ajax page.

i always use response.write (forgot all othere)

is there any othere way to return stuff throw <%myfunc()%> that ajax can handle?

return dosn't seen to wrok

and can u show mw how did u use response.write with ajax and it worked?

thanks


hello again.
well, response.write was the way to go in old asp. asp.net has a great object model so you should work with it instead of using response.write.

you shouldn't use response.write because it just inserts what you're doing on the page where you put it. this might break the the predefined ajax message that is returned from the server to the client.

i'm not sure on what you're trying to do...i'm assuming that myfuc() is a server side method and you want to put its result in the contents that are retrurned to the client. for instance, if you're putting it on a label, you can do something like this (during the load event, for example):

mylabel.Text = func();
Ok, don't use Response.Write for everything, is good for injecting scripts, but otherwise just update the controls, using controls handles is the way to go.

hello.

for injecting scripts you should use the registerXXX methods of the scriptmanager class...


I cannot find another method to solve this problem. I have a button, pressing this, in server I'll check some conditionals, if right, I'll change some text at other places in client that not stored in UpdatePanel (I cannot use so much UpdatePanel cos may be I have to change data in many place, UpdatePanel = Load fully a page)

Or another example, after checking at server, this page should be close and the opener page should be refresh. How can I do if I dont use Response.write (but using updatepanel, response.write is not active)

Thank guards.


Hi there.


I also came across a similar issue and was wondering if you had any insight/suggestions.


I would like to force a file download from code, and on a non-ajax page the following works file, but not when nested in a grid view. Here is the code:


string sFileName = "Foobar.html";
string sHTML = "foo 123";

Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + sFileName);
Response.AddHeader("Content-Length", sHTML.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Write(sHTML);
Response.End();

Any suggestions on how to accomplish this without Response.Write?