开发者

Dynamic data asp.net Query String parameter

开发者 https://www.devze.com 2022-12-16 07:36 出处:网络
Is there a way to define my own querystring parameter in Dynamic data rather then usin开发者_如何学Gog something like

Is there a way to define my own querystring parameter in Dynamic data rather then usin开发者_如何学Gog something like

Edit.aspx?AccountID=1

I want to use something like this

Edit.aspx?id=1


I found a solution for this problem

I simply added this on the pageload method of my edit page template

        string id = String.Empty;
        if(Request.QueryString["id"] != null ){
            id = Request.QueryString["id"].ToString();
            DetailsDataSource.WhereParameters.Clear();
            DetailsDataSource.WhereParameters.Add("AccountID", DbType.Int32, id);
        }
0

精彩评论

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