This topic is locked

No records on the first page option

12/17/2007 10:15:48 PM
ASPRunner.NET General questions
W
warongrit author

Hi,<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7081&image=1&table=forumtopics' class='bbc_emoticon' alt=':unsure:' />

My database have 10k records.I do not want list all records when first enter the list page.

i checked "No records on the first page" option, but it not work. it still show all of records

please help me to find out this problem

Thank you

ASPRunner.net Build 91 MSSQL 2005 Framework version 2.0.50727

Eugene 12/31/2007

Try to use next code in OnLoad events
// List page: OnLoad

public static void ListOnLoad(System.Web.UI.Page Page)

{

GridView gv = (GridView)Page.Master.FindControl("ContentPlaceHolder1").FindControl("dbGrid_TABLENAME");

gv.Visible = ((TextBox)Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtSearchValue")).Text!=string.Empty;
} // ListOnLoad

F
fmbma 1/9/2008

I converted this to VB as follows:
Public Shared Sub ListOnLoad(Page As System.Web.UI.Page)

'Custom code

'put your custom code here

Dim gv As GridView = CType(Page.Master.FindControl("ContentPlaceHolder1").FindControl("dbGrid_vw_Welcome_Out"), GridView)

gv.Visible = (CType(Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtSearchValue"), TextBox)).Text<>String.Empty

End Sub
When I run it, I get the error that 'Cvw_Welcome_Out_Events'is not declared. -

Line 65: End If ' ! Page.IsPostBack

Line 66:

Line 67: Cvw_Welcome_Out_Events.ListOnLoad(Page)

Line 68:

Line 69: End Sub

Try to use next code in OnLoad events

// List page: OnLoad

public static void ListOnLoad(System.Web.UI.Page Page)

{

GridView gv = (GridView)Page.Master.FindControl("ContentPlaceHolder1").FindControl("dbGrid_TABLENAME");

gv.Visible = ((TextBox)Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtSearchValue")).Text!=string.Empty;
} // ListOnLoad

F
fmbma 1/9/2008

I converted this to VB as follows:
Public Shared Sub ListOnLoad(Page As System.Web.UI.Page)

'Custom code

'put your custom code here

Dim gv As GridView = CType(Page.Master.FindControl("ContentPlaceHolder1").FindControl("dbGrid_vw_Welcome_Out"), GridView)

gv.Visible = (CType(Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtSearchValue"), TextBox)).Text<>String.Empty

End Sub
When I run it, I get the error that 'Cvw_Welcome_Out_Events'is not declared. -

Line 65: End If ' ! Page.IsPostBack

Line 66:

Line 67: Cvw_Welcome_Out_Events.ListOnLoad(Page)

Line 68:

Line 69: End Sub

Try to use next code in OnLoad events

// List page: OnLoad

public static void ListOnLoad(System.Web.UI.Page Page)

{

GridView gv = (GridView)Page.Master.FindControl("ContentPlaceHolder1").FindControl("dbGrid_TABLENAME");

gv.Visible = ((TextBox)Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtSearchValue")).Text!=string.Empty;
} // ListOnLoad

Eugene 1/10/2008

Please download and install the latest version of ASPRunner.NET. You can get it here: http://www.asprunner.com/files/asprunnernet-setup.exe

I if doesn't help, please send me your project (including project file, output directory and database backup) on support@xlinesoft.com. I will investigate it on my box.

F
fmbma 1/11/2008

Eugene,

The link you gave is for ver 4. Isn't that still in beta? I'm working from ver 3, build 91. Unfortunately I can't send you the database because it's a large financial db. I will try to reproduce with a non confidential database.

thanks

Please download and install the latest version of ASPRunner.NET. You can get it here: http://www.asprunner.com/files/asprunnernet-setup.exe

I if doesn't help, please send me your project (including project file, output directory and database backup) on support@xlinesoft.com. I will investigate it on my box.

Eugene 1/14/2008

I'm working from ver 3, build 91.


Code that you mention above works only under 4.0 version.

For 3.0 version you can use setting "No records on the first page" at step 4 in asprunner.net wizard.

H
hresto 6/30/2008

The above C# code works for me on build 176, bur it breaks the "Advance" search form containing lookup wizards drop down menus. It return nothing on the List page. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30670&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />