User Control problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top