0

I have a master page MainMaster.master. Also have one aspx page name as AllDetails.aspx which is inherited from MainMaster.Master page.

I have button on AllDetails.aspx, as like below-

<button class="button" type="submit"  onclick="redirect(' + Id + ');">View           Details</button>

On click above button i am calling below function redirect

function redirect(id) 
{ 
    jQuery(xml).find('HK').each(function (i, v)
    {
        window.location.href = "../View/AllDetails.aspx?Uid=" + id;
     }); 
}

As per the above function i am trying to redirect to AllDetails.aspx page. But unfortunately its not redirecting. I checked this function in firbug and tried to debug line by line its working. If i remove the breakpoint and try directly its only refreshing current page.

Please guide.

Govind Singh
  • 15,282
  • 14
  • 72
  • 106
King
  • 16
  • 5
  • why u r trying to redirect in jquery.each loop – Nikhil D Mar 27 '14 at 07:03
  • have you tried window.location instead of window.location.href? and I guess no need of looping here – Neel Mar 27 '14 at 07:03
  • check this http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript/21396837#21396837 – Govind Singh Mar 27 '14 at 07:09
  • In loop i am chceking below condition. I had not given in question to decrese code complexity. jQuery(xml).find('HK').each(function (i, v) { if (parseInt(jQuery(v).find('PR').attr('Id')) == parseInt(id)) { window.location.href = "../View/AllDetails.aspx?Uid=" + id; } }); Also tried window.location -No luck :( – King Mar 27 '14 at 07:29
  • Hi All Any solution for this? – King Mar 28 '14 at 05:45

0 Answers0