开发者

How can I configure a netTiers datasource to use a RouteParameter instead of a QueryStringParameter?

开发者 https://www.devze.com 2023-01-07 18:18 出处:网络
NetTiers works fantastic out of the box using querystrings.Eg: <data:AspnetUsersDataSource ID=\"AspnetUsersDataSource\" runat=\"server\" SelectMethod=\"GetByUserId\">

NetTiers works fantastic out of the box using querystrings. Eg:

<data:AspnetUsersDataSource ID="AspnetUsersDataSource" runat="server" SelectMethod="GetByUserId">
    <Parameters&开发者_JS百科gt;
        <asp:QueryStringParameter Name="UserId" QueryStringField="UserId" Type="String" />
    </Parameters>
</data:AspnetUsersDataSource>

However, if I try to change the parameter to instead be:

<asp:RouteParameter Name="UserId" RouteKey="id" Type="String" />

It just see empty textboxes when navigating to my AspnetUsersEdit.aspx page via the routed url:

user/edit/id

My hunch is this isn't a url routing problem but is instead something I'm missing with how NetTiers fundamentally works. If anyone has successfully used url routing within NetTiers, I'd greatly appreciate any input!


I was able to solve my problem by using FormViews (a slight pain, but good enough for me). One important note that took me some time to solve - NetTiers generated the solution such that periods were contained in the virtual path of the project. Unfortunately this caused havoc with routing when testing locally. Altering the virtual path so as to not contain periods fixed things for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消