Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Wednesday, March 28, 2012

programmatically add calendarextender

hey all,

is this possible to attach a calendarextender control to a textbox? i'm trying to build all my controls dynamically and i'm having problems with postback/async callback behavior. Mainly not understanding what's going on? anyone have any good references on how to do this? That is, build all controls dynamically with some ajax mixed in?

thanks,

rodchar

rodchar:

is this possible to attach a calendarextender control to a textbox? i'm trying to build all my controls dynamically and i'm having problems with postback/async callback behavior. Mainly not understanding what's going on? anyone have any good references on how to do this? That is, build all controls dynamically with some ajax mixed in?

You certainly can do that.

You will just have to create an instance of the calendarextender, assign it the textbox id to its targetcontrolID property. Also make sure this web page/user control has reference to the AJAX tool kit assembly

e.g.

//first add textbox dynamically and give it an IDTextBox myTextBox =new TextBox();myTextBox.ID ="txtCalendar";//now add the calendarExtendar and assign the targetcontrol IDAjaxControlToolkit.CalendarExtender myCalExt =new AjaxControlToolkit.CalendarExtender();myCalExt.TargetControlID = myTextBox.ID;//add both controls to the form/panel control collectionthis.Form1.Controls.Add(myTextBox);this.Form1.Controls.Add(myCalExt);
/

Monday, March 26, 2012

Publisher Policy in future releases

In future releases can we see a publisher policy added to the build? The rate at which builds are coming out it's hard to keep up when using in a production release.

Cheers,
Colin

The Toolkit DLL lives in the BIN directory, so it's my understanding that we shouldn't need a publisher policy. (Please correct me if I'm wrong!) If you're posing the question about ASP.NET AJAX itself, then you'll have better luck asking in one of the non-Toolkit forums.

Saturday, March 24, 2012

Push to all user?

Hi all

It's my first visit to this forum and I must say it's a great job you all do for helping each others.

I'm also new to Atlas and want to build something that can push information to the user, and i wounder if atlas can help me.

I want to start a clock that count down from 1 minute to 0. When a user make a post that trigger this function. And I want all user that browsing the site see the exactly same countdown. And if another user hit a button it will restart and countdown from 1 minute again. Is this possible in Atlas, or were should i search for information to find the soulotion for this.

Cheers Johan

Well the problem is that you cannot send a response to the browser unless the browser has issued a request. Hence if you want to get information from the server without a user actually actively requesting something, you will need to use javascript to make repeated calls to the server (via XmlHttpRequest object) and handle the request.

The non-Atlas javascript function to use would be setTimeout() and XmlHttpRequest manually.

However, since you are using Atlas, it would make sense to use:
http://atlas.asp.net/docs/Client/Sys/Timer/default.aspx

You can then bind this to a pagemethod or web service (asmx). In your case i think an asmx would be the best solution.

The rest of the specifics of the server-side logic I'm sure you can work out ;-) The application Cache would probably be the best place to store your 'countdownLastResetAt' variable...

Hope that helps,
Carlos

Wednesday, March 21, 2012

Question for custom controls builder

Hi,

I build a common (non AJAX) custom control.

My control renderJavaScript with thePage.ClientScript.RegisterClientScriptResource method, so it do not work when inside an UpdatePanel.

How can we detect if the control is placed inside an UpdatePanel and use the correct method to render JavaScript ?

I found a very interesting article but it seems that it do not work with AJAX RTM bits :
http://weblogs.asp.net/leftslipper/archive/2006/11/13/HOWTO_3A00_-Write-controls-compatible-with-UpdatePanel-without-linking-to-the-ASP.NET-AJAX-DLL.aspx

How do you deal with that problem ?

The best way (I think) would be to have it happen at the server level by iterating over the control hierarchy (looking at its ancestor containers) until it gets to Page to see if any of them are of type UpdatePanel.