problem in addin main page to favourites from a pop up page..plz help!!

Last post 05-15-2008 12:30 PM by NC01. 1 replies.

Sort Posts:

  • problem in addin main page to favourites from a pop up page..plz help!!

    05-15-2008, 7:30 AM
    • Member
      point Member
    • suvo
    • Member since 11-14-2007, 11:09 AM
    • Posts 165

    there is main page.on mouse move towards a button pop up opens.now i want to add the parent page to favourites.

    for this i have wiritten in the popup page

    if (e.CommandName == "url")

    {

    DataKey data = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)];

    url_id = Convert.ToInt32(data.Values["url_id"]);

    LinkButton lnk = (LinkButton)GridView1.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("lnkbtnurl_name");if (lnk.Text == "Favourites")

    {

    Response.Write("<script type=\"text/javascript\">window.close('popup.aspx');</script>");

    Response.Write("<script type=\"text/javascript\"> window.external.AddFavorite(window.document.location,document.title);</script>");

     

     

     

    }

    Response.Write("<script type=\"text/javascript\">window.open('" + lnk.Text + "','PopUp','width=400, height=400, menubar=no, resizable=no');</script>");

     

    but pop up gets added to the favourite..i want to add the main page to the favourite from the popup page

  • Re: problem in addin main page to favourites from a pop up page..plz help!!

    05-15-2008, 12:30 PM
    Answer
    • All-Star
      76,317 point All-Star
    • NC01
    • Member since 08-26-2005, 3:33 PM
    • Posts 14,209

    Try:
         window.external.AddFavorite(window.opener.document.location, window.opener.document.title);

    BTW, you should NOT use Response.Write to output your JavaScript. Use the RegisterXxx methods. See http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx for more info.

    NC...

Page 1 of 1 (2 items)