fredag 16 maj 2008
Problem with $find on TabContainer using Master Pages
var tabContainer = $find('TabContainer1');
Therefore, if your page has a Master Page you must instead use the $get method and send the UniqueId of the TabContainer as a parameter. Through the retrurned object, you can get the control object which represents the behaviour of the TabContainer:
var tabContainer = $get('<%= this.TabContainer1.ClientID%><%= TabPassengerInfo.ClientID%>').control;
fredag 5 oktober 2007
ASP.NET Ajax History control example
<cc1:History ID="History1" runat="server"></cc1:History>
<asp:UpdatePanel ID="updPnl" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:MultiView ID="multiView" runat="server">
<asp:View id="viewStep1" runat="server">
...
</asp:View>
<asp:View ID="viewStep1" runat="server">
...
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="History1" EventName="Navigate" />
</Triggers>
</asp:UpdatePanel>
Event that is fired when you press the back button.
public void History1_Navigate(object sender, Microsoft.Web.Preview.UI.Controls.HistoryEventArgs args)
{
string viewId = "";
View historyView = viewStep1;
if (args.State.ContainsKey("BookingSteps"))
{
viewId = (string)args.State["BookingSteps"];
}
foreach (View v in multiView.Views)
{
if (v.ID == viewId)
historyView = v;
}
setActiveView(historyView);
}
Set history point each time you change the view.
private void setActiveView(View view)
{
multiView.SetActiveView(view);
History1.AddHistoryPoint("BookingSteps", view.ID);
}
torsdag 20 september 2007
Using ToolkitScriptManager CombineScripts with url rewrite
To fix this you can add the CombineScriptsHandlerUrl and set this value to "/".
<ajaxtoolkit:toolkitscriptmanager id="ToolkitScriptManager1" runat="server" asyncpostbacktimeout="900" combinescripts="true" combinescriptshandlerurl="/" loadscriptsbeforeui="true">
AjaxControlToolkit: Events inside a Accordion
In this example we have the following structure.
- MasterPage
- Page
- MyAccordion
- MyUserControl
- MyButton
In the Page OnInit you simply put the following line:
LinkButton btn =(LinkButton)(MyAccordion.Panes[0].FindControl("MyUserControl").FindControl("MyButton"));This will make the Accordion to force to load the OnInit in MyUserControl and thus register the MyButton_Click event. It will also enable all other events inside the usercontrol
Hopefully a fix for this will come in a later version of the AjaxControlToolkit.
Reference: http://forums.asp.net/t/1047516.aspx