Book Mark In ASP.Net

Book Mark In ASP.Net

After Performing Some action in application There are Required to jump on Specific
Control or Specific Part of Page.It's Can Be archive by Following method.

Write Down Following code in .Aspx Source Code.

< a name="jumphere1" > < /a >

Write down following Code in .Cs File

     private void registerAnchorScript(String strAnchorID)
        String Script = "";

        Script += " < script language=JavaScript id='BookMarkScript' > ";
        Script += "var hashValue='#" + strAnchorID + "';";
        Script += "if(location.hash!=hashValue)";
        Script += "location.hash=hashValue;";
        Script += " < /script > ";
        if (Page.IsStartupScriptRegistered("BookMarkScript"))
            Page.RegisterStartupScript("BookMarkScript", Script);

Write Down Following Code in Some Event's Like Page Load,Click or else from where you
want to jump on specific Part of page.


Prev Post                                                      All Post                                                           Next Post

Posted in |


Post a Comment