Showing posts with label ctp. Show all posts
Showing posts with label ctp. Show all posts

Wednesday, March 28, 2012

Difference betwwen CTP and beta 1 with GetPostBackEventReference

Hello,

Last week I have create a page with a gridview with textbox in the header row create dynamically.

For each textbox, I had this code in the creating code :

PostBackOptions postBackOptions =new PostBackOptions(oTextBox);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));

With this code, when I make a keyup in a textbox, the gridview is refresh in "Ajax mode" but now, with the Beta 1, the entire page is postaback.

Can you know why ?

PostBackOptions postBackOptions =new PostBackOptions(oGridView);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));


hello,

can you show us the code that is not working?


Hi,

I had a similar problem, but after stepping through the new JavaScript libraries, I came to the conclusion that it was because the control passed to the PostBackOption constructor is not itself inside the UpdatePanel.

Moving it inside the UpdatePanel solved the problem.

Hope this helps,

Bo

Monday, March 26, 2012

Details of: ASP.NET AJAX January Futures CTP?

Hi!

In Details Page ofASP.NET AJAX January Futures CTP, haven't details about the "features". Where I can view this details?

saludos,

Reflector is your friend in situations like this (http://www.aisto.com/roeder/dotnet/)

Opening up Microsoft.Web.Preview in it, there's lots of WebPart stuff, a Timer control, ProfileService, Xml-Scripting


I am also wondering what are the "extended" funtionalities of Futures January CTP. Before I install it on my computer I would like to know what it extends. Has anyone tried it yet?

Design view problem w/Atlas and Visual Studio 2005

New to Atlas:Downloaded Atlas July CTP version and Atlas tools w/Visual Studio 2005 on Server 2003 os. I created a new project and .aspx webpage w/Grid1.master. I am unable to get design view to display without a gray screen appearing, so that I can put server controls in then select my data source. How do I get "design view" to appear without the gray screen?I have this code in my webpage:Help is greatly appreciated.

Open the master page in design mode - NOT your page...( I am assuming that you want to put the datasource controls in the master so all pages have access to them)

Ralph

Saturday, March 24, 2012

Deploy to a web server

As most hosts, my web host will not install any beta products on their server, which means that I'm stuck with the "Atlas" july CTP (which works just fine in the Bin folder). The fact that you need to install ASP.NET AJAX on the server makes it useless for most people. It's great, but I can't use it because it isn't installed on the server. PLEASE! Make a version that works when copied into the /Bin birectory!

Asbj?rn

hello.

well, according to several guys, it works ok if you drop the dll on the bin and set the app to full trust. i guess that most hosts will only install it when v1.0 is released.


And how would I set the app to full trust if I don't have access to the server?
And how would I set the app to full trust if I don't have access to the server?
hello.
well, you just need to ask them the level that your app runs. it mya be running at full trust, though i doubt it.

Wednesday, March 21, 2012

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).

Dec Preview CTP, xml-script and simple data binding

Ok my problem is not that my code doesn't work, it does, but it makes no logical sense and I was hoping someone could explain it to me.

The problem is that when data binding programatically, the steps are: create controls (say a textbox and a label), initialize them (sigh), create the binding object, set the properties of the binding, including specifying the label as "target". Here is the complete woking code for this:

// Create and initialize Controls

var textbox =new Sys.Preview.UI.TextBox($get("TextBox1"));
var label =new Sys.Preview.UI.Label($get("Label1"));
textbox.initialize();
label.initialize();

// Create binding

var binding =new Sys.Preview.Binding();
// Set properties and initialize
binding.set_dataContext(textbox);
binding.set_target(label);
binding.set_dataPath("text");
binding.set_property("text");

// Using a standard Transform

binding.add_transform(Sys.Preview.BindingBase.Transformers.ToString);
binding.set_transformerArgument("Text entered: {0}");
binding.initialize();

When you want to do the same thing in xml-script, the rules seem to change. You no longer set the "target" of the binding, but ad the binding to the "bindings" of the label itself. Here is the working code for that:

<

div>
<inputtype="text"id="TextBox1"/><br/>
<labelid="label1"></label>
</div>

</

form>
<scripttype="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<textBox id="TextBox1" />
<label id="Label1">
<bindings>
<binding dataContext=
"TextBox1"dataPath="text"property="text"transform="ToString"transformerArgument="Text entered: {0}" />
</bindings>

</label>
</components>
</page>
</script>

According to "Programming Atlas" by Wenz, the way the xml-script is doing it is the way it *used to be done* in code. So to set the label as the target, you would have done this:

label.get_bindings().add(binding);

but now, thelabeldoes not have any methods that would support this, like "get_bindings().add" or "add_binding". The code above just fails "object does not support this property or method".

So why is this? Am I missing something? Ths is making no sense to me.

I should say that new APIs are hard enough to learn, but there is no intellisense, and I'm finding places where the API is inconsistant ("get_events" instead of "getEvents" - why the inconsistant camel casing?) And now stuff llike this...?

Also, does anyone know if the dec CTP and the stuff in the "Preview" namespace will be part of RTM1 ? Or will it continue as an unsupported preview. And also,where are the docs for the Preview objects?

Try to take a look at this materials about Futures Dec CTP for reference -http://ajax.asp.net/files/AspNet_AJAX_CTP_to_Beta_Whitepaper.aspx

Hi,

It seems that<binding dataContext="TextBox1"dataPath="text"property="text"transform="ToString"transformerArgument="Text entered: {0}" /> is not working as expected in RC1. ThetransformerArgument doesn't seem to work.

Any idea?

Vlad


Try this (working code snippet)

1<%@. Page Language="C#" AutoEventWireup="true" CodeFile="ControlBindingXmlScript.aspx.cs" Inherits="ControlBindingXmlScript" %>23<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">45<html xmlns="http://www.w3.org/1999/xhtml" >6<head runat="server">7 <title>Untitled Page</title>8<script>9function main()10{11 // Add Client Code here12}13</script>14</head>15<body>16 <form id="form1" runat="server">17 <asp:ScriptManager ID="ScriptManager1" runat="server">18 <Scripts>19 <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" />20 <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewGlitz.js" />21 <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewDragDrop.js" />22 </Scripts>23 </asp:ScriptManager>24 <script>25 Sys.Application.get_events().addHandler("load", main);26 </script>27 <div>28 <input type="text" id="TextBox1" /><br />29 <label id="label1"></label>30 </div>31 </form>32 <script type="text/xml-script">33 <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">34 <components>35 <textBox id="TextBox1" />36 <label id="Label1">37 <bindings>38 <binding dataContext="TextBox1"39 dataPath="text"40 property="text"41 transform="ToString"42 transformerArgument="Text entered: {0}" />43 </bindings>44 </label>45 </components>46 </page>47 </script>48</body>49</html>50
"C#" AutoEventWireup="true" CodeFile="ControlBindingXmlScript.aspx.cs" Inherits="ControlBindingXmlScript" %>

Hi,

You are binding to a label not to a text box. This is still not working (where textBox is an asp:textbox):

<textbox id="textBox">
<bindings>
<binding dataContext="checkBoxBoolean"
dataPath="checked"
property="text"
transform="ToString"
transformArgument="Checkbox is {0}"
direction="InOut" />
</bindings>
</textbox>


Vlad


Hello.

this is working here

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script>
function main()
{
// Add Client Code here
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" />
</Scripts>
</asp:ScriptManager
<div>
<input type="text" id="TextBox1" /><br />
<input type="text" id="text" />
</div>
</form>
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<textBox id="TextBox1" />
<textBox id="text">
<bindings>
<binding dataContext="TextBox1"
dataPath="text"
property="text"
transform="ToString"
transformerArgument="Text entered: {0}" />
</bindings>
</textBox>
</components>
</page>
</script>
</body>
</html>

I've noticed that you're using INOUt for the direction of the binding. I think that the ToString transformer only allows you to specify the In direction.