S
simon
I have dataRepeater:
<asp:Repeater ID="repeater1" Runat="server">
<ItemTemplate>
<%# writeLine(DataBinder.Eval(Container.DataItem, "danIme"))%>
</ItemTemplate>
<FooterTemplate>
<asp:Button ID="btnDelete" Runat="server" Text="Delete"></asp:Button>
</FooterTemplate>
</asp:Repeater>
Then my function:
Protected Function writeLine(ByVal dan As String)as string
writeLine="<input onclick='" & btnDelete.ClientID & ".click()'
type='button' value='Delete'>"
....and so on
End Function
Why I can't use btnDelete.ClientID here?
I would like that when user click the button, the button btnDelete on the
client is clicked. Do you have any solution?
And second question:
If I have:
<ItemTemplate>
<asp:button runat=server id=btnTest></asp:Button>
<%# writeLine(DataBinder.Eval(Container.DataItem, "danIme"))%>
</ItemTemplate>
And my function:
Protected Function writeLine(ByVal dan As String)as string
btntest.visible=false
.....
End Function
Why I can't reference the button in my function. I always get the error
message: Not set to the instance of the object
I set the reference on the beginning of the code behind class:
Protected WithEvents btnTest As System.Web.UI.WebControls.Button
Do you know the answer,
Thank you,
S
<asp:Repeater ID="repeater1" Runat="server">
<ItemTemplate>
<%# writeLine(DataBinder.Eval(Container.DataItem, "danIme"))%>
</ItemTemplate>
<FooterTemplate>
<asp:Button ID="btnDelete" Runat="server" Text="Delete"></asp:Button>
</FooterTemplate>
</asp:Repeater>
Then my function:
Protected Function writeLine(ByVal dan As String)as string
writeLine="<input onclick='" & btnDelete.ClientID & ".click()'
type='button' value='Delete'>"
....and so on
End Function
Why I can't use btnDelete.ClientID here?
I would like that when user click the button, the button btnDelete on the
client is clicked. Do you have any solution?
And second question:
If I have:
<ItemTemplate>
<asp:button runat=server id=btnTest></asp:Button>
<%# writeLine(DataBinder.Eval(Container.DataItem, "danIme"))%>
</ItemTemplate>
And my function:
Protected Function writeLine(ByVal dan As String)as string
btntest.visible=false
.....
End Function
Why I can't reference the button in my function. I always get the error
message: Not set to the instance of the object
I set the reference on the beginning of the code behind class:
Protected WithEvents btnTest As System.Web.UI.WebControls.Button
Do you know the answer,
Thank you,
S