R
Roger
Hi all
On a page I am using a repeater which is linked to an ObjectDataSource
(same page):
<asp:Repeater ID="VideoListNewestRepeater" runat="server"
DataSourceID="VideoListNewestDataSource">
The code for ObjectDataSource looks like this:
<asp:ObjectDataSource ID="VideoListNewestDataSource" runat="server"
EnablePaging="True"
SelectCountMethod="GetCountRowsTotal"
SelectMethod="GetFunVideoListNewest" TypeName="BLL.FunVideo">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="startRowIndex"
SessionField="StartRowIndex"
Type="Int32" />
<asp:SessionParameter DefaultValue="4" Name="maximumRows"
SessionField="MaximumRows"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
SelectMethod GetFunVideoListNewest is a static function of object
BLL.FunVideo (business layer, different project). This function has two
parameters: int startRowIndex, int maximumRows. As you can see, for
both parameters session variables are defined.
In a separate function which is triggered by click event of a
LinkButton (same page) the session variables are set and/or updated and
the select command of ObjectDataSource gets invoked.
LinkButtonNewestRight_Click:
int newestStartRowIndex = 0;
if (Session["StartRowIndex"] != null)
{
newestStartRowIndex = (int)Session["StartRowIndex"];
}
newestStartRowIndex += 4;
Session["StartRowIndex"] = newestStartRowIndex;
Session["MaximumRows"] = 4;
this.VideoListNewestDataSource.Select();
this.VideoListNewestRepeater.DataBind();
But there is the problem that for both parameters of function
GetFunVideoListNewest always only value 0 gets passed!!! The values of
session variables and the default values are not taken into account!
The signature of the invoked function looks like this:
public static List<FunVideo> GetFunVideoListNewest(int startRowIndex,
int maximumRows)
Any clue?
Thanks,
Roger
On a page I am using a repeater which is linked to an ObjectDataSource
(same page):
<asp:Repeater ID="VideoListNewestRepeater" runat="server"
DataSourceID="VideoListNewestDataSource">
The code for ObjectDataSource looks like this:
<asp:ObjectDataSource ID="VideoListNewestDataSource" runat="server"
EnablePaging="True"
SelectCountMethod="GetCountRowsTotal"
SelectMethod="GetFunVideoListNewest" TypeName="BLL.FunVideo">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="startRowIndex"
SessionField="StartRowIndex"
Type="Int32" />
<asp:SessionParameter DefaultValue="4" Name="maximumRows"
SessionField="MaximumRows"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
SelectMethod GetFunVideoListNewest is a static function of object
BLL.FunVideo (business layer, different project). This function has two
parameters: int startRowIndex, int maximumRows. As you can see, for
both parameters session variables are defined.
In a separate function which is triggered by click event of a
LinkButton (same page) the session variables are set and/or updated and
the select command of ObjectDataSource gets invoked.
LinkButtonNewestRight_Click:
int newestStartRowIndex = 0;
if (Session["StartRowIndex"] != null)
{
newestStartRowIndex = (int)Session["StartRowIndex"];
}
newestStartRowIndex += 4;
Session["StartRowIndex"] = newestStartRowIndex;
Session["MaximumRows"] = 4;
this.VideoListNewestDataSource.Select();
this.VideoListNewestRepeater.DataBind();
But there is the problem that for both parameters of function
GetFunVideoListNewest always only value 0 gets passed!!! The values of
session variables and the default values are not taken into account!
The signature of the invoked function looks like this:
public static List<FunVideo> GetFunVideoListNewest(int startRowIndex,
int maximumRows)
Any clue?
Thanks,
Roger