Click here to Skip to main content
15,889,403 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionVisual Studio 2015 and Metro-UI Pin
xiecsuk29-Feb-16 22:59
xiecsuk29-Feb-16 22:59 
QuestionOpening word/pdf document in another window Pin
indian14329-Feb-16 15:39
indian14329-Feb-16 15:39 
AnswerRe: Opening word/pdf document in another window Pin
Richard MacCutchan29-Feb-16 22:04
mveRichard MacCutchan29-Feb-16 22:04 
GeneralRe: Opening word/pdf document in another window Pin
indian14329-Feb-16 22:26
indian14329-Feb-16 22:26 
GeneralRe: Opening word/pdf document in another window Pin
Blikkies29-Feb-16 23:01
professionalBlikkies29-Feb-16 23:01 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:06
indian1431-Mar-16 6:06 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:08
indian1431-Mar-16 6:08 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:22
indian1431-Mar-16 6:22 
Hey buddy still docx is showing binary data doesn't look good to humans man.
Here is the code, can you please let me know where did I do mistake?
Investigator _objInvestigator = new Investigator();
            InvestigatorService _objinvestigatorService = new InvestigatorService();

            int InvestigatorId;
            InvestigatorId = ((Session["InvestigatorId"] != null) && int.TryParse(Session["InvestigatorId"].ToString(), out InvestigatorId)) ? InvestigatorId : 0;
            _objInvestigator = _objinvestigatorService.GetByInvestigatorId(InvestigatorId);
            if (_objInvestigator != null)
            {
                if ((_objInvestigator.CvFile != null) && !string.IsNullOrEmpty(_objInvestigator.CvFileNameWithExt))
                {
                    String ext = System.IO.Path.GetExtension(_objInvestigator.CvFileNameWithExt);

                    //string path = Server.MapPath("~\E:\karthikeyan\venky\pdf\aaaa.PDF");
                    //WebClient client = new WebClient();
                    //Byte[] buffer = client.DownloadData(path);
                    //if (buffer != null)
                    //{

                    if (ext.ToLower() == ".doc")
                    {
                        Response.ContentType = "application/" + "msword";
                        Response.AddHeader("content-length", _objInvestigator.CvFile.Length.ToString());
                        Response.BinaryWrite(_objInvestigator.CvFile);
                    }
                    else if(ext.ToLower() == ".docx")
                    {
                        Response.ContentType = "application/" + "vnd.openxmlformats-officedocument.wordprocessingml.document";
                        Response.AddHeader("content-length", _objInvestigator.CvFile.Length.ToString());
                        Response.BinaryWrite(_objInvestigator.CvFile);
                    }
                    else if (ext.ToLower() == ".pdf")
                    {
                        Response.ContentType = "application/" + ext;
                        Response.AddHeader("content-length", _objInvestigator.CvFile.Length.ToString());
                        Response.BinaryWrite(_objInvestigator.CvFile);
                    }

                }
            }
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

GeneralRe: Opening word/pdf document in another window Pin
Blikkies1-Mar-16 19:48
professionalBlikkies1-Mar-16 19:48 
GeneralRe: Opening word/pdf document in another window Pin
indian1432-Mar-16 15:18
indian1432-Mar-16 15:18 
AnswerRe: Opening word/pdf document in another window Pin
Blikkies29-Feb-16 22:09
professionalBlikkies29-Feb-16 22:09 
QuestionResizing Images, from Bytes[] back to bytes[] Pin
jkirkerx29-Feb-16 10:47
professionaljkirkerx29-Feb-16 10:47 
AnswerRe: Resizing Images, from Bytes[] back to bytes[] [I think its solved] Pin
jkirkerx29-Feb-16 11:45
professionaljkirkerx29-Feb-16 11:45 
General[Now it works], but needs advice on disposing Pin
jkirkerx29-Feb-16 12:51
professionaljkirkerx29-Feb-16 12:51 
QuestionAn Ajax Control is working on local machine not working on Server when deployed Pin
indian14327-Feb-16 14:32
indian14327-Feb-16 14:32 
AnswerRe: An Ajax Control is working on local machine not working on Server when deployed Pin
Nathan Minier29-Feb-16 1:36
professionalNathan Minier29-Feb-16 1:36 
GeneralRe: An Ajax Control is working on local machine not working on Server when deployed Pin
indian14329-Feb-16 11:10
indian14329-Feb-16 11:10 
QuestionASP.Net Pin
Member 1235142825-Feb-16 3:05
Member 1235142825-Feb-16 3:05 
AnswerRe: ASP.Net Pin
ZurdoDev25-Feb-16 4:09
professionalZurdoDev25-Feb-16 4:09 
AnswerRe: ASP.Net Pin
F-ES Sitecore25-Feb-16 21:52
professionalF-ES Sitecore25-Feb-16 21:52 
AnswerRe: ASP.Net Pin
Nathan Minier26-Feb-16 1:29
professionalNathan Minier26-Feb-16 1:29 
AnswerRe: ASP.Net Pin
Manas_Kumar26-Feb-16 7:17
professionalManas_Kumar26-Feb-16 7:17 
AnswerRe: ASP.Net Pin
aarif moh shaikh26-Feb-16 21:00
professionalaarif moh shaikh26-Feb-16 21:00 
QuestionPass ViewModel to view twice Pin
Member 1204569224-Feb-16 23:29
Member 1204569224-Feb-16 23:29 
AnswerRe: Pass ViewModel to view twice Pin
Nathan Minier25-Feb-16 1:53
professionalNathan Minier25-Feb-16 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.