Jason, Thank you for look into this. I changed
q.outSpatialReference = { "wkid": 3734 };
to
q.outSpatialReference = new esri.SpatialReference({ "wkid": 3734 });
This time, when I run the code and click on the polyline, the pop up shows" searching..." for a couple seconds and then still display "no information available". This the same result I got by copy and paste the request URL in the browser:
{"displayFieldName":"NAME","fieldAliases":{"ASSET_NAME":"ASSET_NAME","ASSET_TYPE":"ASSET_TYPE"},"geometryType":"esriGeometryPolyline","spatialReference":{"wkid":102722,"latestWkid":3734},"fields":[{"name":"ASSET_NAME","type":"esriFieldTypeString","alias":"ASSET_NAME","length":15},{"name":"ASSET_TYPE","type":"esriFieldTypeString","alias":"ASSET_TYPE","length":25}],"features":[]}
I am wondering if pop up does not work for a dynamic map service layer that is created by a spatial view in general? The code works fine if the dynamic map service layer is a feature layer coming from a feature class. For test purpose, I created two dynamic map services A and B, A has a feature layer (created from a feature class regionalDrainage), B has a layer coming from a spatial view(created by just select * from feature class regionalDrainage). The code works on A, the pop up shows up with the proper contents, but the code does work display any pop up with B.