Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Wednesday, March 28, 2012

Did I miss something during installation of AJAX 1.0v?

Hi everyone;

I'm using VS2005 and I've just installed AJAX and it works but in the source view it underlines Script Manager, UpdatePanel, contenttemplate and controls under contenttemplate. I guess I missed something that I don't know:) My simple page code is belove:

Thanks... Kaan ?ZGEN

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/Copy of Turuncu.master"AutoEventWireup="false"CodeFile="DNM2.aspx.vb"Inherits="DNM2"title="Untitled Page" %>

<%

@dotnet.itags.org.RegisterSrc="Menu.ascx"TagName="Menu"TagPrefix="uc1" %>

<

asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server"><asp:ScriptManagerid="ScriptManager1"runat="server"/>

<asp:UpdatePanelid="UpdatePanel1"runat="server"UpdateMode="Conditional"><contenttemplate><asp:Labelid="Label1"runat="server"Text="Label"></asp:Label><asp:Buttonid="Button1"runat="server"Text="Button"></asp:Button></contenttemplate></asp:UpdatePanel> <asp:LabelID="Label2"runat="server"Text="Label"></asp:Label><asp:LoginID="Login1"runat="server"></asp:Login><uc1:MenuID="Menu1"runat="server"/>

</

asp:Content>Have you installed SP1 for VS 2005? That can happen if you haven't.

Is there such service pack?? Thanks I didn't know it... :) I'll try and let you know if solved..

Kaan ?ZGEN


Hi mdenn;

Yes that was the problem; now because of you (sayende) I got SP1 and my problem is solved

Thanks..

Kaan ?ZGEN

Saturday, March 24, 2012

Deployment Script for Atlas HTTP Handler

I'm deploy Atlas to several sites and put together a script that registers the Atlas handler across all sites on a machine. If anyone else is in the same situation please feel free to give it a shot:

http://geekswithblogs.net/colinbo/archive/2006/05/11/77937.aspx

Feedback appreciated!

Cheers,
Colin

Cool stuff -- thanks for posting this Colin!

Deploying Atlas to Non Dev Machines

I have an intranent application that gets iframecall.axh errors when deployed. It if I change the script manager paths to point back to a development box.(?).

Debug error message: "A web request made using the iframe executor failed. Make sure that the app's web.config registers iframecall.axd"

What am I missing? Something must need to be done to these test machines to deploy.

The http handler is set :

<addverb="*"path="iframecall.axd"type="Microsoft.Web.Services.IFrameHandler"validate="false"/>

Each of the Web Methods.

WebOperationAttribute(true,ResponseFormatMode.Json,true)

Why does Atlas use the header name and the port to call its self? I found the cause of the problem. Its appears that since we use a CSS ( type of cysco router ) to route traffic on shared servers that the call to the service is using the host header and the port which when re-routed back to the server is incorrect. If the site is available on http://<server>:<port> but the users calls it with the host

headerhttp://<host header> the call back to iframecall ishttp://<host header>:<port>

Here is an example: http://MySite/service1.asmx if hosted onhttp://MyServer:8040/service1.asmx gets called viahttp://MySite:8040/service1.asmx and fails.

Is there a work around for this or how do I fix it?

Wednesday, March 21, 2012

Declarative timer and web service

I am trying to use a declarative script to timer on tick -> web service on complete -> update label.

No problems with updating the label but is there anyway to invoke a service method without resorting to javascript (i.e. pure xml-script)? I imagine I can do something like tick="Sys.Net.ServiceMethod.invoke(..." but it kinda kills the purpose.

Any ideas?

Alex

hello.

i think you're after the servicemethodrequest class.

here's an example of it's declaration:

<serviceMethod id="myService" url="webservice.asmx" methodName="Test">
<completed>
<!--invoke your binding from here-->
</completed>
</serviceMethod>

btw, you can invoke the previous service by using the invokeMethod action (invoke is the name of the method exposed by servicemethod that let's you start the web service method execution).


Luis - yes I am after theServiceMethodRequest class except I would like to invoke the ws via a timer control (w/o resorting to using JS) on tick event:

<timer id="timer" interval="1000" enabled="true" tick="INVOKE WS"/
<serviceMethod id="svc..." url="service.asmx" methodName="GetSomething">
<completed> ...</completed>
</serviceMethod>

While I can write a JS function to invoke the method (and I have done this) I would like to create a version (more elegant) w/o any JS using declarative script. No point for me to use a combination of declarative script to do the binding and ws calls if I still have to write a JS function to call the ws on Tick, might as well do the bindings manually. Right now this is what I do but would be great if I can use the tick event to invoke a ws as well. Any ideas?

AO


hello.

how about something like this;

<timer ...>
<tick>
<invokeMethod target="svc..." method="invoke" />
</tick>
</timer>

if you need parameters, then add them as child element of the invokemethod element...


Thanks that was easy... wish there was an easy way to browse the Atlas library by class with Visual Studio. The documentation didn't make any mention of this (as far as I remember) and from briefly looking in the code I didn't find it.

Luis, thanks again!

Declarative Script is parsed twice

When you start a new Atlas project, the code says at the end
" <script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
</references>
<components>
</components>
</page>
</script>
"
When you build the page, this piece of code is inserted twice (justlook at the source). Is there a way to prevent that, in other words,can't Atlas build his code in the existing script?
This is just a (little) waste of bandwidth

Hi,

That code is there just as a template to help you get started. The second copy of the script that you probably see is what gets rendered by the ScriptManager control.

You can just remove the static XML-Script tag if you're not planning on using it.

Thanks,

Eilon


I see, but wouldn't it be nice to merge the static XML with the XML rendered by the scriptmanager?

Currently the ScriptManager doesn't even know about the static XML script on the page since it doesn't have a runat="server" on it and there's no control that represents it. We're thinking of ways that we can merge these two concepts, and have some ideas, but nothing to show just yet :)

Thanks,

Eilon

Declarative Postbacks in Beta 2

Hello,

I had a small script function to perform a declarative postback. This worked in the July CTP, and we are in the process of upgrading to Beta 2. It is erroring out on not being able to locate the Sys.WebForms.PostBackAction type. Has this been removed/moved? If so, could someone point me in the direction of where it is hiding?

function postbackFromJS(sender, e) {
var postBack = new Sys.WebForms.PostBackAction();
postBack.set_target(sender);
postBack.set_eventArgument(e);
postBack.performAction();
}

Thanks!

I looked around the PageRequestManager class and couldn't find much so it looks like it was removed, though not sure if it was renamed. The docs are lacking in this area.

Anyways, here's the class you can take a look around:http://ajax.asp.net/docs/ClientReference/Sys.WebForms/PageRequestManagerClass/default.aspx


hello.

the postbackaction is defined on the preview.js file (ie, in the value-added bits).