0

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.

Deepak
  • 376
  • 6
  • 23
  • `dbundle.MaterialFetchID....` where did you write this code? In controller action? Can you share the relevant code of `ClassMaterial` action method? – Chetan Apr 23 '18 at 01:36
  • you mean it is calling the action method but the id value is not getting passed? – Rakesh Burbure Apr 23 '18 at 04:46
  • @ChetanRanpariya Yes you gave me the hint for error. It was going to the ClassMaterial action Method. With your help I resolved it. Thanks. – Deepak Apr 23 '18 at 16:10

0 Answers0