Free Support Forum - groupdocs.com

Cannot resolve symbol DocViewerId


#1

Hello,


Following instructions from http://groupdocs.com/blog/how-to-use-groupdocs-viewer-for-net-mvc4, I get “Cannot resolve symbol DocViewerId” error on line


@(Html.ViewerClientCode()
.TargetElementSelector("#test")
.FilePath(“mass_media.doc”)
.DocViewerId(“doc_viewer1”)
.EnableRightClickMenu(true)
.ShowThumbnails(true)
.OpenThumbnails(true)
.ZoomToFitWidth()
.Width(500)
.Height(300))

Can you please help?

#2

Hello Deric,


We are sorry to hear that you have such issue. In the latest version of the GroupDocs.Viewer this property is deprecated and you should simply remove it.

Thank you.

#3

Hello Pavel,

Viewer is still not working in our application. Can you please help?

Here is the Site.Master page:

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@ Import Namespace="Groupdocs.Web.UI" %>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<% Html.CreateViewerScriptLoadBlock(); %>

<%Html.CreateViewerScriptLoadBlock().LoadJquery().LoadJqueryUi(); %>

</head>

<body>

<div id="test" style="width:800px;height:700px"></div>

<% Html.ViewerClientCode()

.TargetElementSelector("#test")

.FilePath("WestSummit.pdf")

.OpenThumbnails(false)

.ZoomToFitHeight(); %>

<asp:ContentPlaceHolder ID="MainContent" runat="server" />

</body>

</html>

Here is the Global.asax.cs:

protected void Application_Start()

{

XmlConfigurator.Configure();

AreaRegistration.RegisterAllAreas();

Groupdocs.Web.UI.Viewer.InitRoutes();

//Groupdocs.Web.UI.Viewer.SetLicensePath();

Groupdocs.Web.UI.Viewer.SetRootStoragePath("C:/testDocuments");

RegisterRoutes(RouteTable.Routes);

There is no css or jquery scripts, and application is running on VS Dev Server (per http://groupdocs.com/docs/display/viewernet/How+to+Use+GroupDocs.Viewer+for+.NET+MVC4)




#4

Hello,


Thank you for the code example. First of all remove this code line: <% Html.CreateViewerScriptLoadBlock(); %>

Then clean your solution , remove all IIS cache and rebuild the solution.

Thank you.

#5

Hi Pavel,


I have done what you suggested but still have the same problem.
Div is showing, but not the viewer.

#6

Hello Deric,


Could you please if possible share with me the project example and I will check and resolve it for you.

Thank you.

#7

I will create a test MVC 4 application, and send you that solution. Thanks!


#8

here is the link to mvc 4 solution with Groupdocs dll

https://www.dropbox.com/s/5b7ov14bf4qwiua/MvcApplication2.rar?dl=0



#9

Hello Deric,


We have fixed your project, please download it here. We have founded such issues:
1. You use Site.Master for the Viewer block - is a wrong place for it
2. You should use .chtml web page for the Viewer (in the fixed project you will find it under Viewer folder)
3. You have missed routing configuration in the Global.asax - please check fixed global.asax
4. In web.config you have missed this option -

Other way in case you needed to use aspx pages - you can simply use such code line in the Site.Master
<%= Viewer.CreateScriptLoadBlock().LoadJquery().LoadJqueryUi().UseHttpHandlers(false) %>
and then on the web page (for example Viewer.aspx) put Viewer widget code.
Please note that if you will use this way you still need to use fixes from steps 3 and 4


Thank you.

#10

Hi Pavel,


Thank you so much, Site.Master works as well!

#11

Hello Deric,


Glad to hear that.

Thank you

#12

Hello Pavel,


Viewer works in our application when I comment out jquery-1.10.2.js.
Can you explain why this causes a problem and if it can be fixed?

0x800a01b6 - JavaScript runtime error: Object doesn’t support property or method 'groupdocsViewer’

Thanks!

#13

Hello,


You have such issue because GroupDocs.Viewer use it’s own jQuery. If you need to use your jQuery library you should set .LoadJquery(false)

Since you set Viewer script loader in the Site.Master the best way is to disable your jQuery. The jQuery will be available for use (version from the Viewer)

Thank you.

#14

Adding ‘false’ parameter value solved the problem.

Can you tell me if there is a limit to document size that can be used with this viewer?

#15

Hi again,


Glad to hear that, no there is no limitations for the file size.

For more information about the Viewer please investigate it’s documentation

Thank you.