PDA

View Full Version : AjaxEvent Parameters in a server-side sub



unaltro2
Jan 21, 2010, 12:32 PM
Hi everyone,

I was asking myself if it's possible, in the following scene:



<ext:Button runat="server" ID="btnOk" Text="Open">
<AjaxEvents>
<Click OnEvent="btnOpenFile_Click" IsUpload="True">
<ExtraParams>
<ext:Parameter Name="theName" Value='<%#Eval("Nome")%>' Mode="Raw" />
<ext:Parameter Name="theExtension" Value='<%#Eval("Estensione")%>' Mode="Raw" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>


to use the parameters ("theName" &amp; "theExtension") within the server-side sub "btnOpenFile_Click" (and not in a web Service).

Thank You.

geoffrey.mcgill
Jan 22, 2010, 2:43 AM
Hi unaltro2,

Do things work properly if you set AutoDataBind="true" on each <ext:Parameter>?


Example



<ext:Parameter Name="theName" Value='<%#Eval("Nome")%>' Mode="Raw" AutoDataBind="true" />


Hope this helps.

unaltro2
Jan 22, 2010, 4:06 AM
Hi,

if I put a different string on the Value parameter (for example Value="Hello"), all works perfect and, on the server-side, i'm really able to obtain the "Hello" string.


But, as I can see, it's not possible to use an AjaxEvent (with its extraparam auto binded), for example, in the button control dinamically generated by an Asp.Net ListView ItemTemplate.


Do it miss something?


Thanks for the help.