Mám v UpdatePanelu Datalist V Datalistu je Button který má událost OnClick
<asp:UpdatePanel ID="SezVTPrevPUP" runat="server" RenderMode="Inline" UpdateMode="Conditional" ChildrenAsTriggers="False">
<ContentTemplate>
<asp:DataList runat="server" ID="SezVTPrevPDL" DataSourceID="SqlSezVTPrevPDL" DataKeyNames="IDPrevProh">
<ItemTemplate>
<br />
<asp:Label ID="DatPrevProhL" runat="server" Text='<%# Eval("DatPrevProh") %>' />
<br />
<asp:Button runat="server" Text="Objednat" ID="ObjPrevProhB" OnClick="ObjPrevProhB_Click" />
<br />
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ScriptCasovac" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
V události Page_Init jsem pro kazdej button pridat asynchr trigger
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
For Each Radek In SezVTPrevPDL.Items
Dim ObjPrevProhB = CType(Radek.FindControl("ObjPrevProhB"), Button)
Dim ObjPrevProhBAPBT As AsyncPostBackTrigger = New AsyncPostBackTrigger()
ObjPrevProhBAPBT.ControlID = ObjPrevProhB.UniqueID
ObjPrevProhBAPBT.EventName = "Click"
SezVTPrevPUP.Triggers.Add(ObjPrevProhBAPBT)
Next
A ted ten problem Kdyz do ObjPrevProhB_Click dám jenom MsgBox tak ten reaguje ale normalni kod pro ukladani do databaze je zcela ignorovan. Vite poradit kde je problem anebo co jsem zapomel ? Dik
|