passing more then one value with the querystring with the same id

前端 未结 1 1803
借酒劲吻你
借酒劲吻你 2021-01-23 17:08

I have a datalist that I want to list the Products that are comming from the Querystring. It works like this: Default.aspx/?ProductID=1 I get 1 product like I want

相关标签:
1条回答
  • 2021-01-23 17:29

    You can have:

    /page.aspx?ProductID=1&ProductID=15&ProductID=25
    

    Then Request.Querystring("ProductID") will return 1,15,25

    This can then be put into an ArrayList like Request.Querystring("ProductID").split(",")

    Passing those 3 values as a parameter is a bit more tricky though, youre probably best passing it as xml:

    Passing multiple values for one SQL parameter

    0 讨论(0)
提交回复
热议问题