Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

Wednesday, March 28, 2012

AJAX becomes full postback in IIS

I made a simple AJAX page in Visual Studio 2005, which has a button click to get server's system time. It works fine inside the VS2005. But when I put it on IIS in Windows Server 2003, the button click becomes a full postback. Do I miss something? Does anyone have any idea?I wrote a testing Ajax website to get server time in a asp:UpdatePanel and deplyed it to Windows Server 2003 IIS.It worked fine and didn't?happen?to full postback.Here are my sample codes for your reference.Wish this can give you some helps.
<div>
<asp:UpdatePanel ID="upnlServerTime" runat="server">
<ContentTemplate>
<asp:Label ID="lblServerTime" runat="server" Text="Server Time"></asp:Label>
<asp:Button ID="btnServerTime" runat="server" Text="Get Server Time" OnClick="btnServerTime_Click" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnServerTime" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</div>
Behind Code:
protected void btnServerTime_Click(object sender, EventArgs e)
{
Label lblServerTime = upnlServerTime.FindControl("lblServerTime") as Label;
lblServerTime.Text = DateTime.Now.ToLongTimeString();
}


I doubt you don't create web application when you create a virtual directory in IIS.Right mouse click virtual directory in IIS and select Properties,Click "Create" button to create application name and Choose Execute Permission for "Scripts only" or "Scripts Executable" from permission DropDownList.Try to addNetwork Service to virtual directory?when?deploying?Ajax?
website.
Wish this can give you some ideas.

Monday, March 26, 2012

AJAX Assembly

I am running visual studio on my desktop and laptop. Both have had the AJAX Control toolkit and AJAX extensions installed. I mostly do my development work on my desktop but every once in a while I take my laptop. When I take my laptop I copy and paste the visual studio 2005 folder from 'documents' and copy it onto my laptop.

I've just done this recently and I am getting errors "Unrecognized tax prefix or device filter 'ajaxToolkit' on all my ajax controls. When I create a new page and insert an ajax control Visual Studio registers an assembly 'Assembly="AjaxControlToolkit" and tags it as "cc1". On my desktop visual studio doesn't register any assembly. It just calls the control <ajaxToolkit:...> and things work.

I've checked the bin folder and it does contain the AJAX dll. I'm sure it's something simple here, can someone tell me what is missing? Thank you.

try this in your aspx

<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>


I know about registering the assembly this way. I was wondering why on my desktop machine I don't have to register the assembly in my aspx and when I open it on my laptop I, all of a sudden, do.


Hi,

This can be also registered in web.config.

For instance:

<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
</controls>

Saturday, March 24, 2012

AJAX and the converted site

I've converted my existing site to 2.0 from 1.1 using the Visual Studio add-on that allows deployment of web projects. Once I converted it, I created a new page with a simple update panel containing a button and a label (the most simplistic of examples) and when clicking the button, I get an 'Unknown Error' alert. When I try to add an UpdatePanel to my existing page, I get

--------
Microsoft Internet Explorer
--------
Assertion Failed: can't find last / in base url

Break into debugger?
--------
OK Cancel
--------

When I create a new ATLAS project, everything seems to work fine. I did notice that if I change the home directory of the default site while the new ATLAS project is still open and then try to click the button in the update panel, I get an 'Unknown Error' popup as well. The reason this might be relevant is because my original 1.1 project was set up to look at the web root as it's location (localhost) as opposed to an application folder (localhost/project). I don't remember why I did this as it was about three years ago. Could this be an issue? How would I go about modifying project files to look at an application folder instead to see if this is the root issue?

Any help is greatly appreciated.

Chris Johnson

Nevermind. I was using the CTP (did I get that right?) and the beta 2 resolved my issues.