c# - ASP .NET Reference Web Element -
i'm new asp .net. i'm attempting duplicate example found here simple in-browser pdf editor.
i made blank asp .net project in visual studio , added _default.aspx code link above:
_default.aspx
<%@ page language="c#" codefile="default.aspx.cs" inherits="_default" %> <%@ register assembly="radpdf" namespace="radpdf.web.ui" tagprefix="radpdf" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>rad pdf sample</title> </head> <body> <form id="form1" runat="server"> <div> <radpdf:pdfwebcontrol id="pdfwebcontrol1" runat="server" height="600px" width="100%" /> </div> </form> </body> </html>
_default.aspx.cs
using system; using radpdf.web.ui; public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { if (!ispostback) { //get pdf byte array file (or database, browser upload, remote storage, etc) byte[] pdfdata = system.io.file.readallbytes(@"c:\users\scotth\desktopt-1 work order - copy.pdf"); //load pdf byte array rad pdf this.pdfwebcontrol1.createdocument("document name", pdfdata); } } }
however, error on last line of _default.aspx.cs:
this.pdfwebcontrol1.createdocument("document name", pdfdata);
the error is:
'_default' not contain definition 'pdfwebcontrol1' , no extension method 'pdfwebcontrol1' accepting first argument of type '_default' found (are missing using directive or assembly reference?)
why reference broken? seems should referencing in _default.aspx:
<radpdf:pdfwebcontrol id="pdfwebcontrol1" runat="server" height="600px" width="100%" />
yet have error. how fix reference? standard way reference these elements in asp .net? in advance.
Comments
Post a Comment