Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ObjectDataSource SelectParameters Source from context.it
Message
De
26/12/2008 05:23:30
 
 
À
25/12/2008 00:08:52
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MySQL
Application:
Web
Divers
Thread ID:
01369694
Message ID:
01369734
Vues:
8
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform