F
ferryandi
hi i created a linkbutton with this code in html
<asp:linkbutton id="Nextbutton"
onclick="PagerButton_Click" runat="server" Text="[Next]"
CommandArgument="Next"></asp:linkbutton>
<asp:linkbutton id="Prevbutton"
onclick="PagerButton_Click" runat="server" Text="[Prev]"
CommandArgument="Prev"></asp:linkbutton>
and i have code behind like this
Sub PagerButtonClick(ByVal sender As Object, ByVal e As
EventArgs)
Dim arg As String = sender.CommandArgument
Select Case arg
Case "Next"
If (DataGrid1.CurrentPageIndex < (DataGrid1.PageCount -
1)) Then
DataGrid1.CurrentPageIndex += 1
End If
Case "Prev"
If (DataGrid1.CurrentPageIndex > 0) Then
DataGrid1.CurrentPageIndex -= 1
End If
End Select
End Sub
so basically when i run it in normal aspx file it will
work
they can read the commanArgument and the bottom written
javascript: _doPostBack('Next','')
BUT when i move to web user control which in ascx file it
didnt work
the web read the commandArgument in javascript:
_doPostBack('myUCP$Next','')
the myUCP is the name of my user control file which is
myUCP.ascx
the problem is i cannot use the commandArgument or in
other when the link is clicked it didnt trigger function
or carry the correct commandArgument
anyone can help?
THAX
<asp:linkbutton id="Nextbutton"
onclick="PagerButton_Click" runat="server" Text="[Next]"
CommandArgument="Next"></asp:linkbutton>
<asp:linkbutton id="Prevbutton"
onclick="PagerButton_Click" runat="server" Text="[Prev]"
CommandArgument="Prev"></asp:linkbutton>
and i have code behind like this
Sub PagerButtonClick(ByVal sender As Object, ByVal e As
EventArgs)
Dim arg As String = sender.CommandArgument
Select Case arg
Case "Next"
If (DataGrid1.CurrentPageIndex < (DataGrid1.PageCount -
1)) Then
DataGrid1.CurrentPageIndex += 1
End If
Case "Prev"
If (DataGrid1.CurrentPageIndex > 0) Then
DataGrid1.CurrentPageIndex -= 1
End If
End Select
End Sub
so basically when i run it in normal aspx file it will
work
they can read the commanArgument and the bottom written
javascript: _doPostBack('Next','')
BUT when i move to web user control which in ascx file it
didnt work
the web read the commandArgument in javascript:
_doPostBack('myUCP$Next','')
the myUCP is the name of my user control file which is
myUCP.ascx
the problem is i cannot use the commandArgument or in
other when the link is clicked it didnt trigger function
or carry the correct commandArgument
anyone can help?
THAX