Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Wednesday, March 28, 2012

Extender TargetControlId not sufficient enough to reference controls not in NamingContaine

Through reflection i see OnPreRender searches for a TargetProperty's TargetControl via its TargetControlID.
It only searches in NamingContainer of the Control this Extender is contained in.
I need ExtenderProperty to take both a NamingContainer and a TargetControlID so I can extend objects directly
on the page when this Extender may appear in a subcontrol.
Are ther plans to support extending Controls outside of the parent's NamingContainer space?
protectedoverridevoidOnPreRender(EventArgs e){base.OnPreRender(e);if ((this.._page;" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=4">_page ==null) && (this.Page !=null)) {this.._page;" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=6">_page =newPageWrapper(this.Page); }ScriptManagermanager1 =ScriptManager.GetCurrent(this.._page;" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=12">_page);if (manager1 ==null) {thrownewInvalidOperationException("You must have a ScriptManager to use an ExtenderControl."); }Controlcontrol1 =this.NamingContainer;using (" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=16">IEnumerator<T>enumerator1=this. Microsoft.Web.UI.ExtenderControl.TargetProperties { ... }" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=17">TargetProperties. System.Collections.ObjectModel.Collection.GetEnumerator();" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=18">GetEnumerator()) {while ( enumerator1 // Local Variable">enumerator1.MoveNext()) {Tlocal1 = enumerator1 // Local Variable">enumerator1..get_Current();" href="http://links.10026.com/?link=http://www.aisto.com/roeder/dotnet/Default.aspx?Object=20">get_Current();Controlcontrol2 =control1.FindControl(local1.TargetControlID);if (control2 !=null) {IScriptControlcontrol3 =manager1.RegisterControl(control2);control3.RegisterBehavior(this);continue; }thrownewInvalidOperationException(string.Format(CultureInfo.InvariantCulture,"Target control with ID '{0}' could not be found for extender '{1}'.",newobject[] {local1.TargetControlID,this.ID })); } }}

The Toolkit doesn't actually run this code - we have an override that will also search for controls at the page level.

Even if the extenders took a NamingContainer property, it doesn't fix the problem. NamingContainers can be nested, so you could end up in the same situation where you can't find the naming container.

In the May 4th release of the Toolkit, we added a "ResolveTargetControlID" event that you can handle to do these types of resolutions yourself. The if the extender can't locate the Control referenced by TargetID, this event will fire and you can return the control instance.

Monday, March 26, 2012

Expanding accordion pane via code

Is it possible to expand an accordion pane either via codebehind or javascript

alternativle is there a way to expand a pane when a control within it gets focus?

Many thanks

Pete

Hi Pete,

Check out the response athttp://forums.asp.net/thread/1422589.aspx.

Thanks,
Ted

expanding accordion pane upon subcontrol getting focus

i'm setting focus to a control via javascript, but if the control is nested within an accordion pane, the panes dont expand.

is there anyway via javascript to expand the panes, apart from clicking on them with the mouse?

cheers

Pete

Hi Pete,

The easiest way will be to callset_SelectedIndex with the index of the pane you want to expand.

Thanks,
Ted

Expand Accordion pane via hyperlink/event

Hello,

Is there a simple way to do a postback for a specific accordion pane via a hyperlink event ie __doPostBack, i have

id appreciate any pointers or direction

Thanks in advance

yes, but you have change original source code in accordion.

you cant do it by modifiy properties setting


Thats a feasable plan. Is there a reference you could point me to?

After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

Is


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

Is


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

Is

there


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

could


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

could

any one


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

could

any one be of


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

could

any


After looking at this source

 // OnClick handler to open the desired pane _onHeaderClick : function(evt) { // Get the appropriate event object depending on the browser // (note: this.may go away when we remove the Safari compat fix in Common) if (!evt) { evt = window.event; } // Get the control that raised the event var header = evt.target; // Walk up its control hierarchy until we find the accordion // pane's header which we marked with the paneIndex field while (header && (typeof(header.paneIndex) === 'undefined')) { header = header.parentNode; } // Select this.pane (which saves it to ClientState and initiates // an animation to show the content pane) this.set_SelectedIndex(header.paneIndex); return false; },

Im guessing that i need to attach this event type to my hyperlink. does anyone know how i could attach this event or raise this code for a specific index like

funcion ExpandPane(IndexNo) {

??header= 'Accordion' + IndexNo

?

}

could

any one be


oops, sorry about that . it looks like i submitted the form before i was done typing and it submitted a bunch...

could someone take care of thisEmbarrassed

i only wanted to say could anyone be of any help?

Wednesday, March 21, 2012

Events

I would like to know if it is posible to obtain the data from theAtlas:datasource object via javascript.
When thedataAvailable event is raised, I'm able to capturre the event in javascript.
I see that it is sending two arguments with the event. I belive the first argument is the
sender and the second is an empty args value. Please correct me if this is wrong.

<!--
<div><spanid="RES">Some type of test data</span></div>


<atlas:DataSourcerunat="server"id="DataSource1"serviceUrl="~/DataService.asmx">
<dataAvailableHandler="traceDataAvailable1">
</dataAvailable>
</atlas:DataSource>

<scripttype="text/javascript">
function traceDataAvailable1()
{

var obj = arguments[0];
window.document.getElementById("RES").innerText = obj ;

}
</script>
-->

In your handler, "obj" will represent the datasource. So, to get to the data, you should do obj.get_data().
On a related note: you can rewrite traceDataAvailable1() to:
function traceDataAvailable(sender, eventArgs) {
...
}
Also, to display the data in the "res" span, you probably want toiterate over the contents of in the data object and concat it to the"innerHTML" property of the span.