need help with ObjectDataSource



Hi,

This is the first time I use ObjectDatasource, I have the following
declaration in aspx file:

<asp:ObjectDataSource ID="odsSubmissions"
SelectMethod="ListBandContestantPaged"
runat="server"
StartRowIndexParameterName="startRow"
MaximumRowsParameterName="pageSize"
SelectCountMethod="GetBandContestantCount"
EnablePaging="true"
TypeName="BandContestAdmin">
<SelectParameters>
<asp:Parameter Name="campaignId" />
</SelectParameters>
</asp:ObjectDataSource>


In code-behind I have:
public DataTable ListBandContestantPaged(int campaignId,int startRow, int
pageSize)
{
}


Question: in the code behind, how do I change the value of campaignId in
code-behind?

I tried
protected void Page_Load(object sender, EventArgs e)
{
campaignId = int.Parse(Request["campaignid"]);
}

Doesn't work at all, I keep getting campaignId as 0 inside
ListBandContestantPaged function.

TIA




.



Relevant Pages

  • how to pass variable to SelectCommand of SqlDataSource?
    ... I want to put a recordset in a gridview but i don't know how to pass the ... i added a tag <selectParameters> but i don't know ... This is my aspx file: ... The code-behind contains this: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: how to pass variable to SelectCommand of SqlDataSource?
    ... variable is set in the code-behind. ... i added a tag <selectParameters> ... This is my aspx file: ... Protected Sub Page_Load(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: asp.net good practices?
    ... programmatic logic code from the presentation layer. ... "Page" class and the class generated from the .aspx file. ... methods and event handlers in your code-behind class and have these ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Simple datalist question
    ... and then moved your c# code from the new aspx to the code-behind? ... one thing you're missing is that when you drop a control on a form ... So by doing this, when the aspx file is loaded, the variable declaration is inherited from the code-behind class, and .NET automatically associates the loaded control in the page to it.. ...
    (microsoft.public.dotnet.framework.aspnet)
  • problem with connecting gridview with data in code-behind
    ... code-behind. ... The problem is that the gridview remains invisible because no records come ... code in aspx file ... Dim dtreader As SqlDataReader ...
    (microsoft.public.dotnet.framework.aspnet)

Loading