Tuesday, October 31, 2006

How to set hyperlinkfield to make it point to local file?

In Web.Config File

appSettings --Begin
add key="AboutTess_Pdf_Path" value="Documents/sampleAboutTess.pdf"
appSettings --End



In .CS File
if(!Page.IsPostBack)
{

string strPDFPath = ConfigurationSettings.AppSettings["AboutTess_Pdf_Path"].ToString();

string popupScript = "Javascript: return " +
"window.open('"+ strPDFPath + "', 'CustomPopUp', " +
"'width=600, height=600, menubar=no, resizable=yes');";

//Attach Script to button control
btnDownloadPDF.Attributes.Add("onclick",popupScript);
}

No comments:

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape