Trying to set document to be loaded from code behind
Problem reported by Sanjay SHah - September 9 at 4:25 AM
Not A Problem
HI,
 
I am currently evalutingDoucmentUltimate and trying to set the document to be loaded from the code behind in my webforms application.
            <GleamTech:DocumentViewerControl runat="server" 
                Width="800" 
                Height="600" 
                Document="~/Documents/test" />
Could someone please provide a simple example,
 
I tried the following:
 DocumentViewerControl.Document = "~/TestDocument.doc"
Error    25    'DocumentViewerControl' is not declared. It may be inaccessible due to its protection level.    WordExcelTest.aspx.vb
 
Could someone please provide a simple example.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post
You need to access any ASP.NET WebForms control via it's ID in codebehind. When not specified the default ID for DocumentViewerControl is "documentViewer" so you can use this:
documentViewer.Document = "~/TestDocument.doc"
 
or you can specify a custom ID:
<GleamTech:DocumentViewerControl runat="server" 
        ID="documentViewer2"
        Width="800" 
        Height="600" 
        Document="~/Documents/test" />
 
 

Reply to Thread