ラベル handle の投稿を表示しています。 すべての投稿を表示
ラベル handle の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

ResizableControlExtender Handle Click Event

I would like to be able to fire the event that occurs when the user clicks on the handle

ResizableControlExtender from my own javascript code.

Do you know how to do this?

Your help is much appreciated.

Thak you very much

Hi,

Internally, this extender doesn't support such behavior.

You may add an resizebegin event handler to the extender, in this handler, call a asynchronous method to invoke to method on server side( web service or pageMethod ) .

So, you code may goes like this:

function pageLoad()

{

var re = $find("behaviorID of the resizableExtender");

re.add_resizebegin(onResizeBegin);

}

function onResizeBegin()

{

//invoke a service side method here.

}

Hope this helps.

2012年3月26日月曜日

Response.Redirect doesnt work with AJAX Extensions Beta 1 (Atlas)

I was using the July Atlas CTP and I decided to give the new AJAX Extensions beta a try... now anytime I call Response.Redirect() when I handle an event for a control that is inside an UpdatePanel I get an error that says, "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed." This happens regardless of whether I'm doing a partial postback or a regular postback as long as the control that caused the event is inside an UpdatePanel.

I found it odd that ScriptManager.IsInAsyncPostBack == true when I clicked a button that wasn't assigned to an AsyncPostBackTrigger... I'm assuming that that probably has something to do with why the Response.Redirect() didn't work. (Yes, I did verify that UpdatePanel.UpdateMode was set to Conditional.)

This is all fine with me I guess as long as there's another way to redirect to another page in server side code. Anyone know what I need to do?

Thanks,
Jon

Calling Response.Redirect() during an async post is supported. Make sure you have the ScriptModule on web.config for this work:

- Federico

  
 <httpModules> <add name="ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </httpModules>

Right after I posted the original message I noticed that I had put the <httpModules> stuff in the wrong place. :)

Response.Redirect on asynchronous postback issue with MasterPage

Hello,

So far Atlas seems to handle Response.Redirects correctly during asynchronous postbacks for me, but I have come accross an issue now (I'm using the April CTP):

I have an asp:Button on a MasterPage inside an atlas:UpdatePanel. When the button is clicked an asynchronous postback happens. On the server I handle the button click event and raise a public event called Update that I defined on the MasterPage. A content page using this MasterPage can attach a handler to this Update event in its Page Load event handler or OnLoad override (the content pages have the MasterType directive set so the event can be accessed through the Master property of the Page) and this handler on the content page can perform whatever updates it likes, like re-databind a GridView (this handler must then also invoke Update on the UpdatePanel containing the GridView). This works fine. But if a handler for this Update event in a content page invokes Response.Redirect, then I get problems. The redirect takes place, but when the new page loads it cannot access any if its Page properties like Request, Response, Session, Application, etc. They all give Null Reference exceptions. After this it seems like the web application has restarted.

So, I think this is an Atlas problem. Whereas Atlas handles Response.Redirects ok during asynchronous postbacks when invoked in a handler on the server of a control event where the handler and control are in the same page, it seems to have a problem when invoked in a method on a content page where the asynchronous postback was initiated by a control in a masterpage. Can anybody in the Atlas development team comment on this and reproduce it and suggest a fix?

I can post a code sample if my explanation is not clear.

If you're wondering why a have this button in a master page that can trigger updates in its content pages, that's because I have a web application where I have one main window from where other pages can be opened in new windows. Any of these newly opened windows must be able to trigger an update in the main window. They can do this programmatically using clientside javascript by calling the click method on the button that is part of the master page in the main window where the main window can be accessed from the newly opened window through the window.opener property. Hope this clarifies what I'm trying to achieve: basically a cross-window trigger for update panels.

kind regards,


Remco

please ignore my post. The target page of the Response.Redirect did not work because I had passed it an incorrect url. The url was something like ~/page.aspx??var=value. It didn't like the double ??. I don't blame it. So no Atlas related issue at all. My fault.

Remco

2012年3月24日土曜日

return straight xml rather than dataset

i just deployed my first webservice. it works perfectly. now, however, i am trying to use it in livecycle and i think livecycle can't handle the dataset which is returned by my webservice. how can i convert my dataset into straight xml?

DataSet ds = new DataSet()
StringWriter writer = new StringWriter();
ds.WriteXml(writer);
return writer.ToString();