ToolTimeGang
asked on
gridview pagesize value set by web.config not working
I would like to set the gridview pagesize value from a web.config entry.
Web.config has this:
gridview has this:
Can you please tell me what I am doing wrong? Thank you!
Web.config has this:
<appSettings>
<add key="pagingSize" value="20" />
</appSettings>
gridview has this:
<asp:GridView ID="gvCustomers1" runat="server" DataSourceID="odsCustomers"
AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True"
EmptyDataText="No data exists" CssClass="siteTable"
DataKeyNames="CustomerID" ViewStateMode="Enabled"
PageSize="<%$ appSettings:pagingSize %>" >
But this is not working. I get "Int32Converter cannot convert from (null)". If I hardcode it to 20, it works just fine.Can you please tell me what I am doing wrong? Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a bunch! I'm good now!!! I sure will mark your answer as helpful!
ASKER
Very speedy with answers. 2nd time today! That is appreciated so very much!
You are most welcome,
Thanks
Thanks
ASKER
PageSize=<%= GetPageSize %>
right? (of course I would first have to add the logic in my code behind)