Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Wednesday, March 28, 2012

Installing Atlas

We want to play and test Atlas before putting into our existing project.

I am here to verifiy that simply installing Atlas will only effect projects (even obtusely)where I actually use the .dll.

SeanMCSE. Yes. It won't affect anything else. Even obtusely.

Monday, March 26, 2012

Installting AjaxExtensions

Hi Friends,

I have been working with ajax now since last 3 months. I have applied in one project and works fine. I am trying to using it in another place and trying to use it in another project. Unfortunately i am not able to apply ajax successfully. I have run the setup file. I installed AjaxExtensions, i tried to test it on one page by putting a normal button inside updatepanel, to see if it is getting refreshed. But on the pageload itself i see javascript error ' Sys' is undefined. I believe its the error from Register Assembly?

I have included all the necessary details in my web config file also.

I dont know where am i doing wrong? Any suggestions would be appreciated.

Thanks

Menon

Did you start with a new website using the Ajax-enabled Website template? Or are you just trying to add some Ajax to a previous web app? If it's the latter, you need to make some changes to your web.config, in addition to installing the extensions.

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


http://www.asp.net/AJAX/Documentation/Live/InstallingASPNETAJAX.aspx

Configure your AJAX like this

http://www.asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx

Internal server error accessing scriptresource.axd

Hi.

I tried to ajax enable our existing web project, but iis7 just fails with a 500 - internal server error, when trying to access scriptresource.axd:

HTTP Error 500.0 - Internal Server Error
Description: Handler "ScriptResource" has a bad module "ManagedPipelineHandler" in its module list
Error Code: 0x8007000d
Notification: ExecuteRequestHandler
Module: IIS Web Core
Requested URL: http://localhost:80/dir/scriptresource.axd
Physical Path: D:\somewhere\dir\scriptresource.axd
Logon User: domain\my.username
Logon Method: NTLM
Failed Request Tracing Log Directory: C:\inetpub\logs\FailedReqLogFiles
Handler: ScriptResource

Creating a new asp.net ajax application works just fine, but ajax enabling out existing app fails. I am pretty sure the web.config is configured correctly. Anyone got any tips on how to resolve this?

hello.

hum... can you give us more details? for isntance, any stack trace? where are you hosting it? iis6?

thanks.


Trying to access the generated scriptresource.axd url just gives me a 500 - internal server error - not sure where to look for a stacktrace. Hosted on IIS7 running on vista. The app is using the classic asp.net app pool, using integrated windows authentication. Some details from the IIS trace:

MODULE_SET_RESPONSE_ERROR_STATUSWarning

ModuleName="IIS Web Core", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="The data is invalid. (0x8007000d)", ConfigExceptionInfo=""

The error appears after the HttpRedirectionModule NOTIFY_MODULE_END event, but before the CustomLoggingModule NOTIFY_MODULE_START event.

Not sure if this info is of any help...


Hi, thanks for reporting that. We have a bug open to track that issue. For the moment, if you can switch the application to integrated mode, that should fix it.
Please add preCondition="integratedMode" to the <add name="ScriptResource" .../> tag of the config file that's near the end, in the system.webserver section.

bleroy:

Please add preCondition="integratedMode" to the <add name="ScriptResource" .../> tag of the config file that's near the end, in the system.webserver section.

Thank you, that seams to work fine :)

Saturday, March 24, 2012

Internet Explorer 5.5

I have a small Atlas project and it will only work with Internet Explorer 6.+ Does Atlas support IE 5.5? When I run the application I get a java script error.ATLAS utilizes many new features(Javascript & XML) only found in new browsers. As it stands I beleive it only works with IE 6+

hello.

i haven't tested it in IE5.5 but it expected it to be supported in that version. well, i'd guess that since 7.0 is out, they won't make any efforts to support it (btw, is there any good reason for not upgrading at least to IE 6?)

Is a "partial postback" really partial?

Hi,

I've inherited a large project and am now in charge of adding AJAX support to it, in order to make it seem more responsive to the users, and to avoid having to perform a complete postback every time the users want to navigate to a different control.

However, my first experiences with using AJAX.NET seem to be a bit disheartening. I added a simple UpdatePanel to the form, as well as a button and a textbox inside of it. The button has a server-side call to update the textbox with DateTime.Now.ToLongTimeString(). Now, whenever I call it, it takes at least 4 seconds to perform a round trip to the server and back with the time. This is unacceptable for our purposes, so I looked into the cause. Our pages are, to put it politely, freaking huge. For the 4-second one, the page is over 100k. So I did some testing, and it appears that on an ajax-postback, the entire page is being posted back to the webserver, constructed, and updated, and finally the relevant pieces (mainly the contents of the update panel) are sent back to be updated.

On the web I've seen many references to so-called "partial postbacks", which I took to mean that the AJAX call is only going to send the contents of the update panel back to the webserver, and not the entire page. Am I incorrect thinking this? In other words: is the entire web page always going to be sent back to the server, even with AJAX calls, or am I missing something important here?

Thanks for your time.

Hi

What you are getting is the default behaviour. What happened in ASP.NET AJAX is that page is posted back to the server and all the page events are rendered as such as in normal postback.

What happens actually, when you put the controls inside Update Panel, only the portion of the data that is inside Update Panel renders back to the server but the complete life cycle of the page behaves normally as normal postback.

So if you want the real power of AJAX, you have to sync with View State and all other stuff.

Hope that helps you..

Bye


Ron,

Your issue there could be ViewState size. Even if the page sends and receives only the data relevant to the UpdatePanel to refresh, ViewState is still transmitted and the complete page life cycle occurs.

Just turn trace on and check you ViewState size. If it's huge, try to find the controls that may have it disabled. If you manage to reduce it's size, your AJAX page will be "faster".

Also, something that really helped me to reduce "page size" and, therefore, AJAX "speed", was to enable IIS dynamic compression.


Cheers,

Juan


Yeah, compression helps, also make sure that your running in compilation mode='release' (in debug the scripts are 3x or more larger). Also, if there's no way to tighten up your viewstate, thne it might be worth it to look at other refresh techniques (more js heavy, less plug-n-play) like PageMethods or Webservices. Those will reduce the traffic to only that which is necessary.


I have found that using update panels and MS ajax will be quite a change in how you philisophically go and layout a page. This is something you will find out over the time you are working on your app. For instance, I had the same type of problem you did with viewstate and page size. I found that I had a gigantic drop down list that was filling up my viewstate and gridviews with lots and lots of records in them. My solution was to get rid of the dropdownlist by using a quick search repeater with a select button on each record. This, in a world with full postbacks would be cumbersome, but with updatepanels becomes quite easy. Second, I have gone the route of creating interfaces similar to regular applications like outlook with a record browse on the left and context on the right. The outer page with browsing is a page and the record is a page that gets popped in an iframe. This allows for a quickie javascript double click to open the record in its own window and a single click to open the record in the context window.

Another big help is managing your refreshes. You will find that using the 'updatemode="conditional"' setting in your update panels will also help to speed up the page. When an updatepanel is left without the conditional mark it postsback on each partial postback. Sometimes the implementation of this can be a bit tricky because you have to call the updatepanel.update() method in codebehind, but the benefit is definately worth the hassle.

Finally, shrinking down what you have in your updatepanels will definately help you keep your page moving quickly. If your entire page with huge drop down lists, etc.. works off one gridview this will be troublesome. When you can put your updatepanel around one textbox, then an updatepanel around the update button, you will be well on your way to super fast processing.

Remember that a partial postback posts back anything within the update panel and, therefore, the more you have in the updatepanel, the more that needs to be sent back to the browser.


Great thoughts, and advice. I'll echo the fact that it's a real balancing act, though. Too much granularity in your updates and you lose scalability. Too little and you kill your bandwidth and users suffer. Good page design can go along way to help you keep the balance.

Wednesday, March 21, 2012

Is ASP.NET Ajax compatible with ClientScriptManager CallBack functions?

The current project usesClientScriptManager CallBack functions to implement a simple callback scenario. Is it OK to add ASP.NET Ajax and use the both ASP.NET Ajax and ClientScriptManager CallBack on the same page?In Ajax,we will use ScriptManager.RegisterClientScriptResource?to register client script.Try to take a look at this link for details -http://ajax.asp.net/docs/mref/M_System_Web_UI_ScriptManager_RegisterClientScriptResource_3_2a609ef4.aspx

Is it necessary to run the Asp.Net Ajax Installation Wizard

I have an issue where my web project works well locally with AJAX, Update Panels and Partial Rendering. Everything is kosher.

As soon as I copy my project to a staging server, any page that uses Validators that become enabled through Partial Rendering seem to have issues. The validators cause script errors on some pages, while on others, they are not visible.

The only difference between my local environment (that I can think of) that may affect this is that I ran the AJAX installation on my local workstation while on the Test Server I just copied the Ajax DLLs into the bin folder.

So does anyone know this may be my problem? Is it necessary to run the full install of ASP.Net AJAX for everything to work well? If not then I may need to resort to custom Javascript for client validation which I'd rather avoid since I can't run the install on the server.

no, but you will need to include the AJAX DLLs in your BIN folder then.


Thanks for your reply! It's good that all I need are the dll's since that's all I have access to do. But that now raises the question of why is it all good locally and not remotely on my test server.

Oh well.. I guess I have 2 options:
(1) Javascript for validation
(2) No partial-rendering.. postbacks and use FakeAjax transitions to make nice ajax-like UI.


alcsharp:

Thanks for your reply! It's good that all I need are the dll's since that's all I have access to do. But that now raises the question of why is it all good locally and not remotely on my test server.

Locally the Ajax DLLs are in the GAC, since you used the Installation Wizard. On the server they aren't there, so you need to explicitly include them.


Oh, and I'm betting you are missing a DLL...
What did you include?


I only included System.Web.Extensions.dll. Since I'm not using the Control Toolkit at all I didn't add it.

Is it possible to "redirect"/URLrewrite ScriptResource.axd?

Hi,

I'm currently working on a project where the client is using a Third-party tool for handling authentication to the website. This means problem because we cannot exclude more files than Default.aspx in the root of the website. The rest of the "unsecure" files needs to be in a special folder. If I look at the source for Default.aspx I see the following (which I understand is AJAX resources?):

<script src="/MySite/WebResource.axd?d=..." type="text/javascript"></script>
<script src="/MySite/WebResource.axd?d=..." type="text/javascript"></script>
<script src="/MySite/ScriptResource.axd?d=..." type="text/javascript"></script>
<script src="/MySite/ScriptResource.axd?d=..." type="text/javascript"></script>

I need to include this resources from another URL. Like this:

<script src="http://pics.10026.com/?src=/MySite/unsec/WebResource.axd?d=..." type="text/javascript"></script>
<script src="http://pics.10026.com/?src=/MySite/unsec/WebResource.axd?d=..." type="text/javascript"></script>
<script src="http://pics.10026.com/?src=/MySite/unsec/ScriptResource.axd?d=..." type="text/javascript"></script>
<script src="http://pics.10026.com/?src=/MySite/unsec/ScriptResource.axd?d=..." type="text/javascript"></script>

Is this possible to do?

regards // Magnus

Hi,

I have tested it with the following code:

Overriding Page.Render and replace the string.

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

<!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 Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
}
protected override void Render(HtmlTextWriter writer)
{
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
base.Render(htw);
string s = sw.ToString();
s = s.Replace("/AJAXEnabledWebSite3/WebResource.axd", "/AJAXEnabledWebSite3/Secure/WebResource.axd");
writer.Write(s.Replace("/AJAXEnabledWebSite3/ScriptResource.axd", "/AJAXEnabledWebSite3/Secure/ScriptResource.axd"));

}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

ThenI received "sys is undefined" error,I think it is because there is no WebResource.axd created in that sub folder, So how to tell ASP.NET to create WebResource.axd in that folder rather than at the root? See following for answer:

AJAX's script handler is performing path check. Hence it is blocking our trick:

Declaring Type: System.Web.Handlers.ScriptResourceHandler
Assembly: System.Web.Extensions, Version=1.0.61025.0

private static void CheckPath(string path)
{
if (!string.Equals(path, VirtualPathUtility.ToAbsolute("~/ScriptResource.axd"), StringComparison.OrdinalIgnoreCase))
{
Throw404();
}
}

To workaround this further, we can:

1. With IIS, create the "Secure" folder under the root directory of our web application (e.g. "C:\Inetpub\wwwroot\AJAXEnabledWebApplication\Secure").

2. Use IIS Configuration Tool to create an child Application for the "Secure" node:

IIS 7.0 Beta: Add a Web Application
http://technet2.microsoft.com/windowsserver2008/en/library/7450f8c5-8d46-4bb2-bd59-4e6ff23df3201033.mspx

The purpose of this is to workaround the virtual path check mentioned above.

3. Open the Web.Config of the application and configure the machine key:

<system.web>
<machineKey
validationKey="0000000000000000000000000000000000000000"
decryptionKey="0123456789012345"
validation="SHA1"/>

This makes the encryption/decryption mechanism consistent between our root application and child application.

4. Apply the code change mentioned previously.

This should work.

This should work.

Best Regards,