Apr 14, 2011, 3:53 PM
obtain extraparams from a button ajaxEvent
Hello,
I'm unable to obtain extraparams values from an AjaxEvent fired from a button click event.
The button is inside a Asp.Net ListView itemTemplate,
and the value i'd like to pass on server-side is embedded dinamically with the 'Eval' function.
I'm able to pass every kind of string but this is not what i would.
easiest markup:
I guess the issue is on extraparams;in this case what else property i need to set on the ajaxEvent?
Thanks a lot.
Fabio.
I'm unable to obtain extraparams values from an AjaxEvent fired from a button click event.
The button is inside a Asp.Net ListView itemTemplate,
and the value i'd like to pass on server-side is embedded dinamically with the 'Eval' function.
I'm able to pass every kind of string but this is not what i would.
easiest markup:
<asp:ListView
ID="ListViewDoc_Richieste"
GroupItemCount="16"
runat="server"
DataKeyNames="ID"
DataSourceID="objectDataSource_Richieste_Doc" > <------------ returns 'Name' and 'Estensione' values
<LayoutTemplate>
<asp:Placeholder
id="GroupPlaceholder"
runat="server" />
</LayoutTemplate>
<GroupTemplate>
<div>
<asp:Placeholder id="ItemPlaceholder" runat="server" />
</div>
</GroupTemplate>
<ItemTemplate>
<asp:UpdatePanel ID="updatePanelDocsRichieste_Documenti" runat="Server">
<ContentTemplate >
<ext:Button runat="server" ID="btnOpen" Text='<%# Eval("Nome").trim() + "." + Eval("Estensione").tolower.trim() %>' >
<AjaxEvents >
<Click OnEvent="btnOpenFile" IsUpload="True" Before="Ext.Msg.wait('Waiting...', 'Downloading...');" Failure="Ext.Msg.show({title:'Download Error', msg:result.errorMessage, buttons: Ext.Msg.OK, icon:Ext.MessageBox.ERROR});">
<EventMask ShowMask="true" MinDelay="500" Msg="Please wait..." />
<Confirmation ConfirmRequest="true" Title='<%# Eval("Nome") %>' Message="Do you wish to open selected doc?"></Confirmation>
<ExtraParams>
<ext:Parameter Name="myName" Value='<%# Eval("Nome").tostring.trim %>' ></ext:Parameter>
<ext:Parameter Name="myExtension" Value='<%# Eval("Estensione") %>' ></ext:Parameter>
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:ListView>
server-side: Protected Sub btnOpenFile(ByVal sender As Object, ByVal e As AjaxEventArgs)
Dim _estensione As String = e.ExtraParams("myExtension") <------------------------------------- is returned an empty string!!!!!!!!!!!!!!!!!!!!!
Dim _nome As String = e.ExtraParams("myName") <------------------------------------- is returned an empty string!!!!!!!!!!!!!!!!!!!!!
I guess the issue is on extraparams;in this case what else property i need to set on the ajaxEvent?
Thanks a lot.
Fabio.
Last edited by unaltro2; Apr 14, 2011 at 5:43 PM.