Showing posts with label exclude. Show all posts
Showing posts with label exclude. Show all posts

Saturday, March 24, 2012

Exclude server controls in an UpadatePanel

Is there a way to exclude server controls that are surrounded by an UpdatePanel?

hello.

what do you meanu by exclude? if you're speaking about not generating html, then just set the enabled property to false...


I have two export buttons inside my usercontrol and said usercontrol is inside an UpdatePanel. I cannot change that it is inside an UpdatePanel, so I cannot just take them out of the UpdatePanel. I want them to generate, I just was wondering if there is a way to exclude them from the UpdatePanel that is surrounding the whole UserControl.

hello.

how about using an udpatepanel inside your user control that delimits all the controls (excluding the buttons)?


Hello, I have the same problem:

I use a GridView inside an UpdatePanel, every row has a 'print' button that generates a RTF document using the server side command 'Response.BinaryWrite'.

The button is generated inside the GridView using a template element, if the gridview is inside the updatepanel the action fails, if the grid is outside the updatepanel the action succeed

How can I exclude the print buttons from the UpdatePanel leaving the other columns updatable?

matteo conta



I have found a solution, not very clean but working:
My problem is how to download a RTF on the browser using a button inside an UpdatePanel, in my case a button inside a GridView:

Insert in the update panel a hidden iframe with runat=server

<atlas:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<iframe id="frameGenerateRTF" runat=server src="http://pics.10026.com/?src=about:blank" width=0 height=0></iframe>
... GridView code....

On theGridView1_RowCommand that generates the RTF export change the src of the IFRAME pointing to the page that generates the binary export

frameGenerateRTF.Attributes.Add("src","Export.aspx?ACTION=PRINT&IDDOCUMENT=12345");

The Export.aspx page uses the Response.BinaryWrite and Response.End() to write a stream (PDF,RTF etc..) to the browser.

You can't use the Response.Redirect on the same page because when you write the binary stream you interrupt the processing on the page usig Response.End() and the atlas page end to respond.

Hope to be usefull
Matteo Conta


I will check it out. Thanks for the help.

How about this:

1a) Set UpdatePanel.ChildrenAsTriggers = false, it is true by default.http://ajax.asp.net/docs/mref/0b850465-67ca-2600-9fdc-2c16d689ab89.aspx
1b) Then any controls inside the UpdatePanel you do want to trigger a refresh, you can set a trigger for.http://ajax.asp.net/docs/tutorials/enhancing/declareTriggers.aspx. (You can set a control like GridView as an async trigger and then all postbacks originating from inside it will be treated as async postback.)

another option

2) Set the control inside the UpdatePanel as a PostBack trigger, i.e. it causes a full page refresh.
<Triggers>
<asp:PostBackTrigger ControlID="YourControlID"/>
</Triggers>

The second option may not be exactly what you are looking for but thought I'd mention it.


hello.

not sure but what i think he wants is to define a zone inside the panel which doesn't get updated...


Oh, if that's the case, I don't know of any easy way to do that. Probably should start by removing the UpdatePanel that wraps everything (including the piece that you dont' want updated) and then add sibling UpdatePanels on the page with UpdateMode=Always.

Thanks marcgel, that helped me alot!

Pat


marcgel:

Oh, if that's the case, I don't know of any easy way to do that. Probably should start by removing the UpdatePanel that wraps everything (including the piece that you dont' want updated) and then add sibling UpdatePanels on the page with UpdateMode=Always.

What is the meaning of "sibling UpdatePanel on the page"? Can you please make it more clear?

Eriawan.

Exclude page_load during ajax content pannel update possible?

I have this in my behind:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(String.Format("{0:yyyy}", DateTime.Now).ToString()))
End Sub

The problem is, whenever I select a new value in my drop down list, it defaults itself back to the current month. Is there a way to exclude this from running when I am using an ajax update panel?

You can use Page.IsPostback for this. It is false for the very first request, and true for any postback (also true for async postback)

If you need to determine whether you have a full or an async postback, you can use:IsInAsyncPostBack


If anyone was curious as to how the syntax looked here it is. Worked like a charm. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (Page.IsPostBack = False) Then DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(String.Format("{0:yyyy}", DateTime.Now).ToString())) End If End Sub

Exclude languages from assembly?

Is it possible to exclude all of the different languages from the assembly? I build web applications that are only used locally, so have no need for all of the different languages, and every time I expand my Bin folder in VS I have to scroll down past all of the folders to see what dlls I've got. Would be nice to have some configuration setting to disable the additional language resources if not needed...?

Thanks,

eddie

i just set up another development machine today and noticed the same problem, but its never happened on other machines


Hi Eddie,

If you want to disable such feature, you may exclude the lines like the following one from the AjaxControlToolkit.csproj file.

<EmbeddedResourceInclude="ScriptResources\ScriptResources.ar.resx"Condition=" '$(Configuration)'=='Release' ">

<SubType>Designer</SubType>

</EmbeddedResource>

You may need to use notepad to edit it.


Hi Raymond,

Thanks for your reply, and sorry it took me so long to reply. I just tried this out - I downloaded the current source for the toolkit, edited the AjaxControlToolkit.csproj file, removing all references to those ScriptResources.[culture].resx and then did a build. I took the resulting dll and replaced the current dll in VS (replaced the reference), but when I did a build it put back all of those folders... Am I missing something?

Thanks again,

eddie


Eddie,

Here is the .csproj file of mine:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B3B89160-3224-476E-9076-70B500C816CF}</ProjectGuid>
<OutputType>Library</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>AjaxControlToolkit</AssemblyName>
<RootNamespace>AjaxControlToolkit</RootNamespace>
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>AjaxControlToolkit.snk</AssemblyOriginatorKeyFile>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AlwaysVisibleControl\AlwaysVisibleControlBehavior.js" />
<EmbeddedResource Include="CascadingDropDown\CascadingDropDownBehavior.js" />
<EmbeddedResource Include="CollapsiblePanel\CollapsiblePanelBehavior.js" />
<EmbeddedResource Include="Common\Common.js" />
<EmbeddedResource Include="ConfirmButton\confirmButtonBehavior.js" />
<EmbeddedResource Include="DropShadow\DropShadowBehavior.js" />
<EmbeddedResource Include="HoverMenu\HoverMenuBehavior.js" />
<EmbeddedResource Include="ModalPopup\ModalPopupBehavior.js" />
<EmbeddedResource Include="NumericUpDown\NumericUpDownBehavior.js" />
<EmbeddedResource Include="PopupControl\PopupControlBehavior.js" />
<EmbeddedResource Include="ReorderList\DropWatcherBehavior.js" />
<EmbeddedResource Include="ResizableControl\ResizableControlBehavior.js" />
<EmbeddedResource Include="RoundedCorners\RoundedCornersBehavior.js" />
<EmbeddedResource Include="TextboxWatermark\TextboxWatermark.js" />
<EmbeddedResource Include="ToggleButton\ToggleButton.js" />
</ItemGroup>
<ItemGroup>
<Compile Include="Accordion\AccordionCommandEventArgs.cs" />
<Compile Include="Accordion\AccordionItemEvent.cs" />
<Compile Include="Accordion\AccordionItemType.cs" />
<Compile Include="Accordion\Accordion.cs" />
<Compile Include="Accordion\AccordionContentPanel.cs" />
<Compile Include="Accordion\AccordionDesigner.cs" />
<Compile Include="Accordion\AccordionExtender.cs" />
<Compile Include="Accordion\AccordionExtenderDesigner.cs" />
<Compile Include="Accordion\AccordionPane.cs" />
<Compile Include="Accordion\AccordionPaneCollection.cs" />
<Compile Include="Accordion\AutoSize.cs" />
<Compile Include="AlwaysVisibleControl\AlwaysVisibleControlDesigner.cs" />
<Compile Include="AlwaysVisibleControl\AlwaysVisibleControlExtender.cs" />
<Compile Include="AlwaysVisibleControl\HorizontalSide.cs" />
<Compile Include="AlwaysVisibleControl\VerticalSide.cs" />
<Compile Include="Animation\Animation.cs" />
<Compile Include="Animation\AnimationExtender.cs" />
<Compile Include="Animation\AnimationExtenderDesigner.cs" />
<Compile Include="Animation\AnimationJavaScriptConverter.cs" />
<Compile Include="Animation\AnimationScripts.cs" />
<Compile Include="AutoComplete\AutoCompleteDesigner.cs" />
<Compile Include="AutoComplete\AutoCompleteExtender.cs" />
<Compile Include="Calendar\CalendarDesigner.cs" />
<Compile Include="Calendar\CalendarExtender.cs" />
<Compile Include="CascadingDropDown\CascadingDropDownDesigner.cs" />
<Compile Include="CascadingDropDown\CascadingDropDownExtender.cs" />
<Compile Include="CascadingDropDown\CascadingDropDownNameValue.cs" />
<Compile Include="CollapsiblePanel\CollapsiblePanelDesigner.cs" />
<Compile Include="CollapsiblePanel\CollapsiblePanelExpandDirection.cs" />
<Compile Include="CollapsiblePanel\CollapsiblePanelExtender.cs" />
<Compile Include="Common\BoxSide.cs" />
<Compile Include="Common\DateTimeScripts.cs" />
<Compile Include="Common\ThreadingScripts.cs" />
<Compile Include="Common\CommonToolkitScripts.cs" />
<Compile Include="Compat\DragDrop\DragDropScripts.cs" />
<Compile Include="Compat\Timer\TimerScript.cs" />
<Compile Include="ConfirmButton\confirmButtonDesigner.cs" />
<Compile Include="ConfirmButton\confirmButtonExtender.cs" />
<Compile Include="DragPanel\DragPanelDesigner.cs" />
<Compile Include="DragPanel\DragPanelExtender.cs" />
<Compile Include="DropDown\DropDownDesigner.cs" />
<Compile Include="DropDown\DropDownExtender.cs" />
<Compile Include="DropShadow\DropShadowDesigner.cs" />
<Compile Include="DropShadow\DropShadowExtender.cs" />
<Compile Include="DynamicPopulate\DynamicPopulateDesigner.cs" />
<Compile Include="DynamicPopulate\DynamicPopulateExtender.cs" />
<Compile Include="ExtenderBase\AnimationExtenderControlBase.cs" />
<Compile Include="ExtenderBase\ClientCssResourceAttribute.cs" />
<Compile Include="ExtenderBase\ClientPropertyNameAttribute.cs" />
<Compile Include="ExtenderBase\ClientScriptResourceAttribute.cs" />
<Compile Include="ExtenderBase\ComponentReferenceAttribute.cs" />
<Compile Include="ExtenderBase\Constants.cs" />
<Compile Include="ExtenderBase\Design\ExtendedTypeDescriptionProvider.cs" />
<Compile Include="ExtenderBase\Design\ExtenderBaseDesignerHelpers.cs" />
<Compile Include="ExtenderBase\Design\ExtenderControlBaseDesigner.cs" />
<Compile Include="ExtenderBase\Design\ExtenderControlBaseDesigner.PageMethodSignatures.cs" />
<Compile Include="ExtenderBase\Design\ExternalReferences.cs" />
<Compile Include="ExtenderBase\Design\PageMethodSignatureAttribute.cs" />
<Compile Include="ExtenderBase\Design\TypeControlIDConverter.cs" />
<Compile Include="ExtenderBase\DynamicPopulateExtenderControlBase.cs" />
<Compile Include="ExtenderBase\ElementReferenceAttribute.cs" />
<Compile Include="ExtenderBase\ExtenderControlBase.cs" />
<Compile Include="ExtenderBase\ExtenderControlEventAttribute.cs" />
<Compile Include="ExtenderBase\ExtenderControlMethodAttribute.cs" />
<Compile Include="ExtenderBase\ExtenderControlPropertyAttribute.cs" />
<Compile Include="ExtenderBase\IClientStateManager.cs" />
<Compile Include="ExtenderBase\IControlResolver.cs" />
<Compile Include="ExtenderBase\ProfilePropertyBinding.cs" />
<Compile Include="ExtenderBase\ProfilePropertyBindingCollection.cs" />
<Compile Include="ExtenderBase\RequiredPropertyAttribute.cs" />
<Compile Include="ExtenderBase\RequiredScriptAttribute.cs" />
<Compile Include="ExtenderBase\ResolveControlEventArgs.cs" />
<Compile Include="ExtenderBase\ResolveControlEventHandler.cs" />
<Compile Include="ExtenderBase\ScriptControlBase.cs" />
<Compile Include="ExtenderBase\ScriptObjectBuilder.cs" />
<Compile Include="ExtenderBase\ScriptUserControl.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExtenderBase\ServicePathConverter.cs" />
<Compile Include="FilteredTextBox\FilteredTextBoxDesigner.cs" />
<Compile Include="FilteredTextBox\FilteredTextBoxExtender.cs" />
<Compile Include="FilteredTextBox\FilterModes.cs" />
<Compile Include="FilteredTextBox\FilterTypes.cs" />
<Compile Include="HoverExtender\HoverExtenderDesigner.cs" />
<Compile Include="HoverExtender\HoverExtender.cs" />
<Compile Include="HoverMenu\HoverMenuDesigner.cs" />
<Compile Include="HoverMenu\HoverMenuExtender.cs" />
<Compile Include="HoverMenu\HoverMenuPopupPosition.cs" />
<Compile Include="ListSearch\ListSearchDesigner.cs" />
<Compile Include="ListSearch\ListSearchExtender.cs" />
<Compile Include="ListSearch\ListSearchPromptPosition.cs" />
<Compile Include="MaskedEdit\Compatibility\BaseValidator.cs" />
<Compile Include="MaskedEdit\Compatibility\IBaseCompareValidatorAccessor.cs" />
<Compile Include="MaskedEdit\Compatibility\IBaseValidatorAccessor.cs" />
<Compile Include="MaskedEdit\Compatibility\IWebControlAccessor.cs" />
<Compile Include="MaskedEdit\Compatibility\ValidatorHelper.cs" />
<Compile Include="MaskedEdit\MaskedEditCommon.cs" />
<Compile Include="MaskedEdit\MaskedEditDesigner.cs" />
<Compile Include="MaskedEdit\MaskedEditEnum.cs" />
<Compile Include="MaskedEdit\MaskedEditExtender.cs" />
<Compile Include="MaskedEdit\MaskedEditTypeConvert.cs" />
<Compile Include="MaskedEdit\MaskedEditValidator.cs" />
<Compile Include="ModalPopup\ModalPopupExtender.cs" />
<Compile Include="ModalPopup\ModalPopupDesigner.cs" />
<Compile Include="MutuallyExclusiveCheckBox\MutuallyExclusiveCheckBoxDesigner.cs" />
<Compile Include="MutuallyExclusiveCheckBox\MutuallyExclusiveCheckBoxExtender.cs" />
<Compile Include="NoBot\NoBot.cs" />
<Compile Include="NoBot\NoBotDesigner.cs" />
<Compile Include="NoBot\NoBotEventArgs.cs" />
<Compile Include="NoBot\NoBotExtender.cs" />
<Compile Include="NoBot\NoBotState.cs" />
<Compile Include="NumericUpDown\NumericUpDownDesigner.cs" />
<Compile Include="NumericUpDown\NumericUpDownExtender.cs" />
<Compile Include="PagingBulletedList\PagingBulletedListDesigner.cs" />
<Compile Include="PagingBulletedList\PagingBulletedListExtender.cs" />
<Compile Include="PasswordStrength\PasswordStrengthExtenderDesigner.cs" />
<Compile Include="PasswordStrength\PasswordStrengthExtenderExtender.cs" />
<Compile Include="PasswordStrength\PropertyEnumerations.cs" />
<Compile Include="PopupControl\PopupControlDesigner.cs" />
<Compile Include="PopupControl\PopupControlExtender.cs" />
<Compile Include="PopupExtender\PopupExtender.cs" />
<Compile Include="PopupExtender\PopupExtenderDesigner.cs" />
<Compile Include="PopupExtender\PositioningMode.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Rating\Rating.cs" />
<Compile Include="Rating\RatingDesigner.cs" />
<Compile Include="Rating\RatingExtender.cs" />
<Compile Include="ReorderList\BulletedList.cs" />
<Compile Include="ReorderList\BulletedListItem.cs" />
<Compile Include="ReorderList\DraggableListItemExtender.cs" />
<Compile Include="ReorderList\DropWatcherExtender.cs" />
<Compile Include="ReorderList\ReorderHandleAlignment.cs" />
<Compile Include="ReorderList\ReorderList.cs" />
<Compile Include="ReorderList\ReorderListDesigner.cs" />
<Compile Include="ReorderList\ReorderListEvents.cs" />
<Compile Include="ReorderList\ReorderListInsertLocation.cs" />
<Compile Include="ReorderList\ReorderListItem.cs" />
<Compile Include="ReorderList\ReorderListItemCollection.cs" />
<Compile Include="ReorderList\ReorderListItemLayoutType.cs" />
<Compile Include="ReorderList\RepeatDirection.cs" />
<Compile Include="ResizableControl\ResizableControlDesigner.cs" />
<Compile Include="ResizableControl\ResizableControlExtender.cs" />
<Compile Include="RoundedCorners\BoxCorners.cs" />
<Compile Include="RoundedCorners\RoundedCornersDesigner.cs" />
<Compile Include="RoundedCorners\RoundedCornersExtender.cs" />
<Compile Include="Tabs\TabPanelDesigner.cs" />
<Compile Include="ToolkitScriptManager\ScriptCombineAttribute.cs" />
<Compile Include="Slider\SliderDesigner.cs" />
<Compile Include="Slider\SliderExtender.cs" />
<Compile Include="Slider\SliderOrientation.cs" />
<Compile Include="SlideShow\Slide.cs" />
<Compile Include="SlideShow\SlideShowDesigner.cs" />
<Compile Include="SlideShow\SlideShowExtender.cs" />
<Compile Include="Tabs\TabContainer.cs" />
<Compile Include="Tabs\TabContainerDesigner.cs" />
<Compile Include="Tabs\TabPanel.cs" />
<Compile Include="Tabs\TabPanelCollection.cs" />
<Compile Include="TextboxWatermark\TextboxWatermarkExtender.cs" />
<Compile Include="TextboxWatermark\TextboxWatermarkExtenderDesigner.cs" />
<Compile Include="ToggleButton\ToggleButtonExtender.cs" />
<Compile Include="ToggleButton\ToggleButtonExtenderDesigner.cs" />
<Compile Include="ToolkitScriptManager\ToolkitScriptManager.cs" />
<Compile Include="UpdatePanelAnimation\UpdatePanelAnimationDesigner.cs" />
<Compile Include="UpdatePanelAnimation\UpdatePanelAnimationExtender.cs" />
<Compile Include="ValidatorCallout\ValidatorCalloutDesigner.cs" />
<Compile Include="ValidatorCallout\ValidatorCalloutExtender.cs" />
</ItemGroup>
<ItemGroup>
<None Include="AjaxControlToolkit.snk" />
<None Include="app.config" />
<None Include="ExtenderBase\Design\ExternalReferences.t4" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Accordion\AccordionBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ReorderList\DraggableListItemBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PasswordStrength\PasswordStrengthExtenderBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FilteredTextBox\FilteredTextBoxBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Rating\RatingBehavior.js" />
<EmbeddedResource Include="PagingBulletedList\PagingBulletedListBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DynamicPopulate\DynamicPopulateBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ExtenderBase\BaseScripts.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Animation\AnimationBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Animation\Animations.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="UpdatePanelAnimation\UpdatePanelAnimationBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="NoBot\NoBotBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Slider\SliderBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Slider\Images\slider_h_handle.gif" />
<EmbeddedResource Include="Slider\Images\slider_h_rail.gif" />
<EmbeddedResource Include="Slider\Images\slider_v_handle.gif" />
<EmbeddedResource Include="Slider\Images\slider_v_rail.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MutuallyExclusiveCheckBox\MutuallyExclusiveCheckBoxBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DropDown\drop-arrow.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DropDown\DropDownBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ValidatorCallout\alert-large.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ValidatorCallout\ValidatorCalloutBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ValidatorCallout\alert-small.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ValidatorCallout\close.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="HoverExtender\HoverBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PopupExtender\PopupBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DragPanel\FloatingBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Compat\DragDrop\DragDropScripts.js" />
</ItemGroup>
<ItemGroup>
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Compat\Timer\Timer.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Common\DateTime.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Calendar\CalendarBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Calendar\arrow-right.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Calendar\arrow-left.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\Tabs.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-right.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-line.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-left.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-hover.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-hover-right.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-hover-left.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-active.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-active-right.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\tab-active-left.gif" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MaskedEdit\MaskedEditBehavior.js" />
<EmbeddedResource Include="MaskedEdit\MaskedEditValidator.js" />
<EmbeddedResource Include="Properties\Resources.resx">
<SubType>Designer</SubType>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<CustomToolNamespace>AjaxControlToolkit</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Tabs\Tabs.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Calendar\Calendar.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Slider\Slider.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DropDown\DropDown.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AutoComplete\AutoCompleteBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Common\Threading.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="SlideShow\SlideShowBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ListSearch\ListSearchBehavior.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Accordion\Accordion.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AlwaysVisibleControl\AlwaysVisible.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Animation\Animation.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AutoComplete\AutoComplete.ico" />
<EmbeddedResource Include="Calendar\Calendar.ico" />
<EmbeddedResource Include="CascadingDropDown\CascadingDropDown.ico" />
<EmbeddedResource Include="CollapsiblePanel\CollapsiblePanel.ico" />
<EmbeddedResource Include="ConfirmButton\ConfirmButton.ico" />
<EmbeddedResource Include="DragPanel\DragPanel.ico" />
<EmbeddedResource Include="DropDown\DropDown.ico" />
<EmbeddedResource Include="DropShadow\DropShadow.ico" />
<EmbeddedResource Include="DynamicPopulate\DynamicPopulate.ico" />
<EmbeddedResource Include="FilteredTextBox\FilteredTextBox.ico" />
<EmbeddedResource Include="HoverMenu\HoverMenu.ico" />
<EmbeddedResource Include="ListSearch\ListSearch.ico" />
<EmbeddedResource Include="MaskedEdit\MaskedEdit.ico" />
<EmbeddedResource Include="ModalPopup\ModalPopup.ico" />
<EmbeddedResource Include="MutuallyExclusiveCheckBox\MutuallyExclusiveCheckBox.ico" />
<EmbeddedResource Include="NoBot\NoBot.ico" />
<EmbeddedResource Include="NumericUpDown\NumericUpDown.ico" />
<EmbeddedResource Include="PagingBulletedList\PagingBulletedList.ico" />
<EmbeddedResource Include="PasswordStrength\PasswordStrength.ico" />
<EmbeddedResource Include="PopupControl\PopupControl.ico" />
<EmbeddedResource Include="Rating\Rating.ico" />
<EmbeddedResource Include="ReorderList\ReorderList.ico" />
<EmbeddedResource Include="ResizableControl\ResizableControl.ico" />
<EmbeddedResource Include="RoundedCorners\RoundedCorners.ico" />
<EmbeddedResource Include="ScriptResources\ScriptResources.resx">
<SubType>Designer</SubType>
</EmbeddedResource>

<EmbeddedResource Include="Slider\Slider.ico" />
<EmbeddedResource Include="SlideShow\SlideShow.ico" />
<EmbeddedResource Include="Tabs\Tabs.ico" />
<EmbeddedResource Include="TextboxWatermark\TextboxWatermark.ico" />
<EmbeddedResource Include="ToggleButton\ToggleButton.ico" />
<EmbeddedResource Include="UpdatePanelAnimation\UpdatePanelAnimation.ico" />
<EmbeddedResource Include="ValidatorCallout\ValidatorCallout.ico" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<ProjectExtensions>
<VisualStudio AllowExistingFolder="true" />
</ProjectExtensions>
<!-- Strip the comments out of any JavaScript files that were embedded as resources -->
<UsingTask TaskName="AjaxControlToolkit.JavaScriptCommentStripperTask" AssemblyFile="$(MSBuildProjectDirectory)\..\Binaries\JavaScriptCommentStripper.dll" />
<PropertyGroup>
<CompileDependsOn>
StripJavaScriptComments;
$(CompileDependsOn)
</CompileDependsOn>
</PropertyGroup>
<Target Name="StripJavaScriptComments" Condition=" '$(ConfigurationName)'=='Release' ">
<CreateItem Include="@.(ManifestNonResxWithNoCultureOnDisk)" Condition="'%(Extension)'=='.js'">
<Output TaskParameter="Include" ItemName="EmbeddedJavaScriptSourceFiles" />
</CreateItem>
<JavaScriptCommentStripperTask SourceFiles="@.(EmbeddedJavaScriptSourceFiles)" DestinationFiles="@.(EmbeddedJavaScriptSourceFiles)" />
</Target>
</Project>

It works perfectly as you required.


Thanks, I tried it again and it worked. Must have missed something before. Your project file didn't work for me - got all kinds of errors, but I went back and re-edited the original project file and did a new build and that worked.

Thanks again!

eddie

exclude events

hi...

Is there anyway to exclude events from page life cycle when callBack events is occur, and include those events when postBack occur?

thank you...

Hi,

no, but you can use the IsInAsyncPostBack property of the ScriptManager to determine if a partial postback or a regular postback is running and take different actions.


hi...

thank you for your answer...

First of all, the script manager that i use plcaed in master page. so, can i say, all evets that server side controls within any update panel(in masterPage or content page) will raise, cause to IsInAsyncPostBack property to be true? and, all evets that server side controls that out of any update panel(in masterPage or content page) will raise, or, cotrols that progrematically raise callBack events will cause to IsInAsyncPostBack property to be false?

thank you...


Hi,

yes, unless the controls outside the UpdatePanel are triggers for it (in this case, IsInAsyncPostBack = true),

Exclude are from UpdatePanel

Is there a way to exclude an area from the UpdatePanel?

I ask because I have a usercontrol that has a StepWizard and one of the steps has a file upload. The page that contains the usercontrol has an UpdatePanel that wraps the usercontrol.

The same issue + suggestion ishere.

"I made something named PopupCallback feature for popups calling a server side method on it's opener."

Could you elaborate on this? I'm not really sure what you are doing.

I can't believe this ability wasn't built in to Atlas...hopefully future versions will look at this.


Well you probably have been into the scenario where you have this "Oh crap, I saved something in my popup, now I want the opener page to rebind is grid, to show that the changes were reflected!"
And this should be done without any nasty hacks like window.opener.document.getElementById("fuglyHack").click();

So what I did was to make something a bit more elegant:

First off, I should make it a singleton control that has to exist on Page (like ScriptManager), now I have it embedded in the actual page:

using System;using System.Text;using System.Collections;using System.Collections.Generic;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;namespace SomeMysticCompany.Web.SomeWebProject.SiteCore{/// <summary> /// Summary description for BasePage /// </summary>public abstract class BasePage : System.Web.UI.Page, IPostBackEventHandler {private static readonly object EventCommand =new object();public event CommandEventHandler PopUpCallback { add {base.Events.AddHandler( EventCommand,value ); } remove {base.Events.RemoveHandler( EventCommand,value ); } }protected override void OnPreRender( EventArgs e ) {this.Page.ClientScript.RegisterClientScriptBlock(typeof( Page ),"PopUpCallback","function BasePage_PopupPostBack( argument ) { __doPostBack('__Page', argument); }",true );base.OnPreRender( e ); }public void SetCloseScript() {this.ClientScript.RegisterStartupScript(typeof( Page ),"close","window.close();",true ); }public void SetPopupCallbackScript(string commandName,params object[] arguments ) {this.ClientScript.RegisterStartupScript(typeof( Page ),string.Format("PopupCallback_{0}", commandName ),this.GetPopupPostBackReference( commandName, arguments ),true ); }public string GetPopupPostBackReference(string commandName,params object[] arguments ) {object[] data =new object[ 2 ]; data[ 0 ] = commandName; data[ 1 ] = arguments;return string.Format("window.opener.BasePage_PopupPostBack('{0}');", Server.HtmlEncode( Util.GetBase64String( data ) ) ); }#region IPostBackEventHandler Memberspublic void RaisePostBackEvent(string eventArgument ) { CommandEventHandler handler =base.Events[ EventCommand ]as CommandEventHandler;if ( handler ==null )return;object[] data = Util.GetDataByBase64ObjectString( Server.HtmlDecode( eventArgument ) )as object[];if ( data ==null )return; CommandEventArgs args =new CommandEventArgs( data[ 0 ]as string, ( data.Length > 1 ) ? data[ 1 ] :null ); handler(this, args ); }#endregion }}

That's the first piece of code. Now, to get a reference to create a popup callback script you just call
"SetPopupCallbackScript", or just use "GetPopupPostBackReference" if you want it on a client click or something.

Now, the interesting part is the server side HANDLER of the callback... what happens is that when you execute the script returned from these methods, you will set a serialized object array on the window.opener and submit.
The only thing you need to do is to hook up to the event exposed:

// Some user control or whateverprotected override void OnInit( EventArgs e ){this.Page.PopUpCallback +=new CommandEventHandler( Page_PopUpCallback );base.OnInit( e );}private void Page_PopUpCallback(object sender, CommandEventArgs e ){if ( e.CommandName !="GetData" )return;this.LoadData();}
This will call "LoadData" if you have the popup executing the script:
// In popup, actually outputting script to raise event on openerprivate void Finish(){this.Page.SetPopupCallbackScript("GetData" );}
Is this clear to you? This provides a bit more clean way to pass data without losing it's integrity.
Sorry, referencing this.Page instead of base is just stupid, I am just so used to doing that, replace it!

I'll have to take some time to look it over. I'm actually trying to exclude a file upload control from a step wizard. I don't usually code at this level but I think I see how it's working.

Thanks for working with me!