Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
change function so it will only get a part of the users
Cassie Mod
Mar 6 2017 9:19 AM
161
Reply
HI ,
Ive got the following webapp. using asp.net /c# .
Now when we go to the userpage. The page_load will be loaded.
IN the paige load there is a function to check if it is a postback. If it isn't a postback a function is called to get the users and show them in a repeater. However. The first time it loads it get all the users. the second time it doesn;t get the users ( because, it is a postback). Olso every page shows 10 users ( for now) we can change that by editing the pageSize.
How can i change te code, so it will only get the users it need ( not all of them). here is the code. please give me some advice or tips how to change the code.
protected
void
Page_Load(
object
sender, EventArgs e)
{
try
{
if
(PortalApplication ==
null
)
return
;
if
(!IsPostBack)
FillRptUsers();
}
catch
(Exception ex)
{
PortalApplication.HandleException(ex);
ShowFailureText();
}
}
public
void
FillRptUsers()
{
var serviceProviderId = PortalApplication.User.serviceProviderId;
var groupId = PortalApplication.User.groupId;
var users = PortalApplication.GetGroupUsers(serviceProviderId, groupId, UserFilter.Text, (CurrentPage - 1) * PageSize, PageSize);
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
i got the some error
How to do Pie Chart