Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ObjectDataSource SelectMethod
Message
 
 
À
05/07/2010 11:38:18
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01471404
Message ID:
01471414
Vues:
24
>OK, I found some sample code on-line and this is what I can try:
>
>
<asp:ObjectDataSource ID="odsRiders" runat="server" SelectMethod="GetRidersAndWaiversByPlan"
>                                    TypeName="SamaanSystems.IAS.Business.Plan">
>                                    <selectparameters>
>                                        <asp:querystringparameter name="planPK"  querystringfield="planpk" defaultvalue="-1" />
>                                    </selectparameters>
>                                    </asp:ObjectDataSource>
>
>However, I am not using a querystring to pass in the value I need. I can access the value in the aspx.cs file like this: this.oPolicy.Entity.PlanFK
>
>So how would I use that in the aspx file?

For your case the only way is to specify generic parameter Parameter Name = "PlanPK" type = "Int32"

and then set your parameter's value in Selecting event of ObjectDataSource.

I have a blog on a similar problem (for SQLDataSource), never tried myself this technique with ObjectDataSource. When you get it to work, post your code and I'll update my blog with your sample:

See here
http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/setting-sqldatasource-parameter-from-the
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform