Link to home
Create AccountLog in
Avatar of jmestep
jmestep

asked on

Passing multipl text box values to .net repeater datasource

I am re-doing a page someone built for an ecommerce site where customers could enter multiple skus and quantity of each and return the contents of a repeater control based on that with the quantity entered as what matched the sku that was entered.
For example:
skuOne   2
skuTwo  10
skuThree 3

The datasource for the repeater can use a method ProductDataSource.LoadForCriteria([sql where clause here]). The page is now written using html text boxes and action using an html submit button. Then he has this code in the C# .cs file:
if (Request.Form["action"] == "Add to basket")
        {
            sSkuArr = Request.Form["sku"].Split(',');
            sQtyArr = Request.Form["qty"].Split(',');
....................
It doesn't work for my purposes because I'm having to have the result repeater inside an update panel because when options are selected for the product before it is added to the basket, price changes. I've taken the structure for that control from a different ecommerce page where multiple  items can be added to the cart on one page.

What is the best way to get this data of the Sku and Quantity array passed to the ProductDataSource.LoadForCriteria? Both pieces of code need to stay on the same page.
Also, in the first section where the skus are input, we need to be able to generate the number of rows of sku and quantity box based on a parameter we pass to the control.
Thanks

ASKER CERTIFIED SOLUTION
Avatar of mildurait
mildurait
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account