Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Wednesday, March 28, 2012

why not EnablePartialRendering="true"?

why the attribute is not set by default, is there any specific behavior?

enablePartialRendering

="true"

Yes - it changes the way script manager deals with the page. This allows UpdatePanel to work. Without an UpdatePanel on the page, you don't need it enabled.


thank- i see that

but isnt the update panel the mostly used? or ... activate the partial reendering when update panel comes to page ...


I haven't worked through all the scenarios here, but one of them is that the UpdatePanel has some issues in Safari right now. Perhaps this question would be better suited for the general Atlas forum. Thanks!

Return Value

true if partial rendering is enabled and full-page updates are suppressed; otherwise,false. The default istrue.

Remarks

Even if theEnablePartialRendering property istrue,partial-page rendering might not occur for the following two reasons:the browser does not support partial-page rendering or theSupportsPartialRendering property is set tofalse.

You can override the value of theEnablePartialRendering property at run time during or before the page'sInit event. If you try to change this property after the page'sInit event has occurred, anInvalidOperationException exception is thrown.

why ScriptManager is not recognized by VS?

Hi,

I drag and drop AJAX ScriptManager control to the source view of default.aspx, here is the code (the third and fourth lines are for ScriptManager):

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
Status:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Selected="True" Value="false">Active</asp:ListItem>
<asp:ListItem Value="true">Complete</asp:ListItem>
</asp:DropDownList>

But I found ScriptManager tag is underlined with curly red line. When I mouse hover on ScriptManager tag, I see a tip

Element ScriptManager is not a known element. This can occour if there is a compilation error in the website.

But I could compile and run the site successfully. The bugging thing is that all the AJAX control, such as UpdatePanel is not recognized by VS too.

any idea?

Thx

Tao

From what I know, this is what is happening...

The cause for this error is, in your web.config look for this tag...and change the tagprefix from default asp to anything else...

<controls>
<add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls
and now change the <asp:UpdatePanel> to <ajax:UpdatePanel> . All your errors should be gone.

please Let us know if this fixes...


This does solve the problem. But I don't understand why. Originally, the AJAX control defined in System.Web.Extensions is registered as tagPrefix = asp. So when I use asp:ScriptManager tag, VS should be able to locate the assembly and recognize it, theoritically. Do you know why I have to replace "asp" prefix with something else, such as ajax?

Thx

Tao


Theoretically I too expected the same. We found this fix on some blog(Thanks to him for posting it), I forget the link!. But it solved the dirty red squiggly lines and I made a note of it. May be, experts here can give hind sight of why and the details behind this...

Happy Coding :)

Monday, March 26, 2012

With AJAX, Using method="GET" instead of the default "POST" - possible?

Guys,

We are trying to use GET instead of POST to reduce the size of the packets sent to the server with each partial postback.

1) How do I do this? I tried specifying method="get" inside the form declaration, didn't work.

2) is this a stupid idea? Our viewstate can go to 8 kb or so. Does GET always tack on the view state to the

URL string?

Thanks !

http://kochukeralam.com

hello.

well, if i recall correctly, the only way you have to do that is to handle the client initializeRequest or beginrequest client event. for instance, if you choose to handle the beginrequest event, the method will receive a referece to the current webrequest object that is being used to make the call (again, we're talking about client objects, which means writing js). that object has a property called httpVerb which you can set to specify the type of call you're making

and yes, i'd probably stick with the post method...


The way a partial postback works, you NEED the ViewState in order to create an instance of the Page, run through its life cycle, and generate the HTML that needs to be returned to the PageRequestManager. So, even if you retooled it to use GET, you'd need to send the ViewState on the QueryString anyway (which would be difficult in the ~2k max you have to work with there).

You're right to be conscious of the ViewState size though. A better solution would be to look into changing where the ViewState is persisted at. Check this out: http://weblogs.asp.net/scottgu/archive/2006/06/18/PageStatePersister-Extensibility-with-ASP.NET-2.0.aspx


hello. hum, i'm not sure if i'm following. if I'm not mistaken, you can disable viewstate and the page should keep working without any problems...

Sure, if the page is designed to not rely on the ViewState (which is always a good option), then it's not needed for any type of request.

However, I believe the original poster was thinking if he could simply switch to a GET, then he could avoid sending the ViewState back to the server for partial postbacks. That wouldn't work, unless ViewState was persisted on the server side somehow (which would make GET and POST equally performant anyway).


hello again.

oh,. i see...then you're absolutely right.

Saturday, March 24, 2012

Works in VWB 2008, but not in my website

I created a nice-wroking site in VWB 2008 express edition, but when I uploaded all the files (images, all files in bin directory, default asp page and vb page, css sheet and web.config) the site gives an unknown error:http://www.wiki-pedia.co.il/

I tried to follow the directions in that page and add <customErrors mode="Off"/> to web.config but nothing happend. What should I do?

Thanks,
Yoni

What you should try to do first of all is upload a web.config that contains ONLY this:

<!-- Web.Config Configuration File --
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

If you were able not to figure out the problem, try to contact the support at the hosting server!

HTH,
Regards


yonidebest:

I tried to follow the directions in that page and add <customErrors mode="Off"/> to web.config but nothing happend. What should I do?

Thanks,

please make sure that the hosting company supports .Net 3.5 or .Net3.0 and the Ajax extensions issues ...


Oh darn. I wonder if I can get my money back...


I noticed that I get an error when entering Microsoft's website: "Server Error in '/' Application."
for ex.http://msdn2.microsoft.com/en-us/library/k6h9cz8h(vs.71).aspx

Why is this? I have no access to most of microsoft's site.


yonidebest:

I noticed that I get an error when entering Microsoft's website: "Server Error in '/' Application."
for ex.http://msdn2.microsoft.com/en-us/library/k6h9cz8h(vs.71).aspx

Why is this? I have no access to most of microsoft's site.

you must have access to above link, it works for me.

whats i want to mention here is that you have to make sure this site is not blocked by a proxy in your network or comapny


it doesn't work. I am a private user, I've never touch my network settings. Note that I usually use IE6 (where I get the error) but I have FF too for design purposes and the microsoft site works fine there. I noticed it doesnt work in IE6 after I installed ASP 3.5 and the framework, as well as VWB 2008. Perhaps on of these programs touched my network settings?

Yoni


Well, I don't see a better solution that contacting the hostnig support and ask them to check on the server what is happening with your website. They can help you more and on the spot!!

Thanks


Well, I turned to my hosting support and they installed what ever it was I needed. It seems to be working correctly now:
http://www.wiki-pedia.co.il/

Thanks for your help.
Yoni


I am glad it works for you!

Usually, when you are sure your work is running well locally and having problems on the server, better to email the support on the spot!!

Regards

Wednesday, March 21, 2012

Wrong URL for Webservice

Hello

I've a Problem with Webservice Calls and/or Scripttags (not sure)
In the default.aspx I've the following Script declaration:

<asp:ScriptManager ID="scriptManager" runat="server" ScriptMode="debug">
<services>
<asp:servicereference path="~/webservices/myWebservice.asmx" />
<services>
<asp:ScriptManager /
Some times the Service is called with this URL: http://www.mySite.com/webservices/myWebservice.asmx/webservices.myWebservice
The extra "/webservices.myWebservice" is wrong and the Page could not be found.

I'm sure the wrong URL is generated from Javascript (in one of the JS-Files from the Framework) when executing the functions in myWebservice or from the generated HTML-Code from the Default.aspx Page (something like <script language="javascript" src="http://pics.10026.com/?src=http://www.mySite.com/webservices/myWebservice.asmx/webservices.myWebservice />)

Any Ideas how to solve this error? Are there any Updates for the AJAX-Framework?

Your webservice is only like thishttp://www.mySite.com/webservices/myWebservice.asmx

there is no need for webservices.myWebservice /

try it


This is the normal way a webservice method is called. There is nothing wrong in it.

The method name is appended to the webservice url

For example, if you are calling a method called method1 on webservice.asmx, the url will look like

http://.../webservice.asmx/method1


But why do I get errors like the following:

Ausnahmeinformationen:
Ausnahmetyp: InvalidOperationException
Ausnahmemeldung:Request format is unrecognized for URL unexpectedly ending in '/webservices.myWebservice'.

Anforderungsinformationen:
Anforderungs-URL:http://www.mySite.ch/webservices/myWebservice.asmx/webservices.myWebservice
Anforderungspfad: /webservices/myWebservice.asmx/webservices.myWebservice

Threadinformationen:
Thread-ID: 1
Stapelüberwachung: bei System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
bei System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
bei System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
bei System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
bei System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

If I try to call the webservice directly, I get the same error in Browser.


Check if you have this in the web.config. I have seen this to cause this error

<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>


Thank you for the tipp. That code is not in the web.conf. I'll try if it helps.


I would guess that your web.config is missing these entries:

<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"/>
</httpHandlers>

XHTML 1.1 Firefox and Opera problem

I installed AJAX Beta2 and used the CTP template to create a new web site. Which creates default.aspx page, with the doc type of:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
I have a table with images. I run the page in IE7 looks perfect. I ran in FF and Opera the cells height are 5 to 10 px to big. After pulling my hair for about 2 hours. I notice the doctype.
I set it to this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
And the table is correct (works in IE as well).
Should an AJAX site doctype be XHTML 1.1? Does it matter? Why did this break firefox on something so simple as a table?
Thanks
Rick 
AJAX should support site doctype XHTML 1.1 in the release version. I aslo find the similar issue to yours.The Ajax control size?is?somewhat?different?
in?different?browers?such?as?IE,FireFox,Opera,Safari.

Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability.
The Ajax technique uses a combination of:
XHTML (or HTML) and CSS, for marking up and styling information.
The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented.
The XMLHttpRequest object is used to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server, and in other implementations, dynamically added <script> tags may be used.
XML is sometimes used as the format for transferring data between the server and client, although any format will work, including preformatted HTML, plain text, JSON and even EBML. These files may be created dynamically by some form of server-side scripting.