How to:Pass arguments to views and use that as contextual filter-in code I have a views created in code. I am passing arguments(for contextual filters) to this view from another view like this:

sitename/apage?ids=1,2

Q1. Is this the correct method? If not what is?

Q2. How do i retrieve 1 and 2 (above) in the view where i want to use them as filters(contextual) for products/nodes with these ids.

Please help!
Contextual filters are passed not like $_GET parameters but like part of an url (by $_GET parameters exposed filters are sent).
if you want send several values for one contextual filter - you need to separate them with comma or plus.

For example you have view with url '/product' and 2 contextual filters - 1st filter is product ids, and second one is country id.
The url of a view can look like this 'product/12,45/55'
In this example view will take 12 and 45 as product id and 55 as country id.