Showing posts with label scriptmanager. Show all posts
Showing posts with label scriptmanager. Show all posts

Wednesday, March 28, 2012

Changed control prefix doesnt apply when dragging control from toolbox

Hello,

due to problems with Intellisense not recognizing the new ajax controls such as updatepanel and scriptmanager I tried to give them a different prefix. I thought ajax would be nice instead of asp, so I specified this in my web.config

<add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
However, when I drag 'n drop an Ajax control from the toolbox it will still get the asp prefix. Now I've done some custom control development, so I know you can give a control an attribute called ToolboxData where you can use a placeholder for the actual prefix. So did the Ajax developers not use this, or do I need to do something else to get my new prefix when I select a control from the toolbox?

hello.

well, I'm thinking that they've only used the tagprefixattribute to set the default attribute of the controls...


Yes, but the design surface and intellisense will normally use the prefix that is specified in the web.config. However, I think I may have found a bug. It seems there might be a problem is there's a newline character in the assembly attribute. Maybe you could try this out to confirm this?

Thanks!

Change in behavior of RegisterStartupScript

In Beta 1, it is requried to use the ScriptManager.RegisterStartupScript method, and this method requires that a control that is within the partial update is passed as the first parameter.

All my pages inherit the same BasePage, and I wan't to register a startup script every time a partial update occurs, regardless of where the update is done.

Please change this back so that the Page.ClientScript.RegisterStartupScript method can be used!

Einar

I need a page based RegisterStartupScript as well. I haven't seen anything from Microsoft mentioning that they would bring this back. Is there a way to run Java Script from a class file?

Thanks,

Jennifer


We can't properly support RegisterStartupScript itself since there's no way to know what people registered. However, we're considering an option to allow people to call a new method (or perhaps change an existing method) to register scripts that should always get included in the async post.

Thanks,

Eilon


Thats great news Eilon, crossing my fingers, would simplify things a great deal :-)

By the way, big thanks to the team for all the great sessions in Barcelona last week!

Einar


Eilon,

This would be great. If the RegisterStartupScript of the ScriptManager did not require a reference to a control in an update panel, life would be much easier. Thanks,

Mark

Monday, March 26, 2012

catching the postBacks of UserControl inside another UserControl

My problem is that i've got:

MasterPage with a Menu, ScriptManager and a UpdatePanel, inside of wich i've put the the ContentPlaceHolder. I've put the Menu as trigger for the UpdatePanel

In the ContentPage i want to show, i have a UserControl that has inside of itself another UserControl.

Even putting an UpdatePanel in the ContentPage containing the UserControl (Parent), the whole page refreshes instead of been only the ContentPage, due to the UpdatePanel of the MasterPage.

All the UpdatePanels have de UpdateMode as Conditional.

How can i make this work, refreshing only the contentPage or the area pretended of the contentPage?

i've seen other Posts, but they only talk of one UserControl.

Thanks a lot.

You've got two problems:

First, the menu control is not compatible with partial-page updates and therefore not compatible with updatepanel controls.

Second, if you are using a master page, you are going to get a full refreshevery time you load a content page. When you navigate to a content page, you are not just reloading the part of the page that is in the contentplaceholder. You are loading anentire page that is a meshing of the master and content page. So what you are trying to do is not possible. Placing an updatepanel around a contentplaceholder does nothing. Different page = refresh.


thanks for your answer, but what i meant was the case of the usercontrols. the use of them makes me refresh the whole page, even though the content page is inside a update panel, i've tried to put the control inside a updatepanel conditional mode, but it still doesn't work.

this usercontrol was another one inside itself.


See if this article helps:

http://asp.net/ajax/documentation/live/tutorials/UsingUpdatePanelUserControls.aspx