Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ObjectDataSource SelectParameters Source from context.it
Message
From
26/12/2008 05:23:30
 
 
To
25/12/2008 00:08:52
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MySQL
Application:
Web
Miscellaneous
Thread ID:
01369694
Message ID:
01369734
Views:
9
>I have 1 parent form call 1 child form by using :
>
>
>        Context.Items["pplId"] = DetailsView1.SelectedValue.ToString();
>        Server.Transfer("cusAdd.aspx");
>
>
>
>
>In Child Form (cusAdd.aspx), have an ObjectDataSource.
>
>How to configure the ObjectDataSource SelectParameters Source from context.items["pplId"]?
>
>
> <asp:ObjectDataSource ID="odsCusById" runat="server" 
>        SelectMethod="GetPplById" TypeName="pplBLL"
>        <SelectParameters>
>            <asp:QueryStringParameter DefaultValue="0" Name="id" ...... <------------------------------------??????????????
>        </SelectParameters>
>
>
>

Maybe (conditionally) replace the parameter in the Page.Load?
            odsCusById.SelectParameters.Remove(odsCusById.SelectParameters["Id"]);
            odsCusById.SelectParameters.Add(new Parameter("Id",System.Data.DbType.String,
                HttpContext.Current.Items["pplId"].ToString()));
(Untested)
Previous
Reply
Map
View

Click here to load this message in the networking platform