I know this is an old question and answered multiple times, but they don't solve my problem. I've seen several questions like this and this.
So I'm simply trying to pass my ID value using querystring like :-
$scope.MaterialView = function (ID) {
ClassFactory.RedirectMaterialView(ID).then(function (d) {
//$window.open(d.data, '_blank');
var queryString = d.data + '?id=' + ID;
var popup = window.open(queryString, '_blank');
if (popup) {
popup.onload = function () {
console.log(popup.innerHeight > 0 ? '' : alert('Pop_Up Blocked By Your Browser'));
}
} else {
alert('Pop_Up Blocked By Your Browser');
}
}, function (error) {
alert('Cannot Redirect to Material');
})
}
Now this is giving me result as :-
http://localhost:31015/Home/ClassMaterial?id=122
But I'm not able to access id in my c#.
I tried this:-
dbundle.MaterialFetchID = Convert.ToInt32(Request.QueryString["id"]);
and this:-
public ListViewModel FetchMaterialDetail(string id)
{
dbundle = (DataBundle)TempData["DBundle"];
dbundle.MaterialFetchID = Convert.ToInt32(id);
Both of them are giving me null values. Any help is appreciated.