0
for (int i = 0; i < dt.Rows.Count; i++)    
{                
    function(dt.Rows[i][0].ToString());   
}   

I tried to loop the selected values from the gridview and put it inside a datatable. Now, my problem is that when I tried the code above to pass the value from datatable to my function. It works, but just once and the loop stops. Can somebody help me please?

The function is for downloading pdf file.

3
  • 3
    How many rows dt has. If it runs only one time may be there is only one row in data table. Commented Oct 10, 2017 at 4:05
  • There must be some additional code here. How is dt set? Commented Oct 10, 2017 at 4:44
  • I think the dt is working, when i put break point. It gets the selected values Commented Oct 10, 2017 at 5:13

2 Answers 2

1

If the function is sending a binary pdf file to the response stream, it may be calling Response.End which would halt the thread.

If you want to send multiple files the client needs to make multiple requests or the server needs to package them up, like in a zip file.

Sign up to request clarification or add additional context in comments.

1 Comment

You're right sir, when i remove the Response.End, the error said multiple disposition. now, my problem is I don't know how to put all the pdf into zip then download it.
0

Try function function_Name(code) {}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.