Free Support Forum - groupdocs.com

CreateScriptLoadBlock() is not a member when i hit F5?


#1
Hi
When i hit F5 in VS 2012 always i will get "CreateScriptLoadBlock() is not a member" if i use Build and Rebuild solution 4 to 5 times than only that error disappear,if i change some codes in my application and hit F5 again appear,each and every time i need to use Build and Rebuild 4 to 5 times to solve CreateScriptLoadBlock() is not a member error

http://prntscr.com/3yjpox

Pls reply asap
Regards
Aravind

#2

Hello,

We are sorry to hear that you have such issue. We checked your code from the screenshot you provided and looks like the code is correct. According to your description of the issue we suppose that the issue with project configuration, but not with the code. One of possible issues can be incorrect configuring of project references.

To resolve the issue please make sure that path for the GroupDocs.Viewer.dll does not lead to the “bin” folder. For example:

Wrong path – c:\{your project root}\bin\GroupDocs.Viewer.dll

Correct path – C:\{your project root}\Dependencies\GroupDocs.Viewer.dll

GroupDocs.Viewer.dll should be placed in any folder you want except “bin” folder of your project. To the “bin” folder it will be copied by the project on build action.

After that please clean your solution and build it again

If this will not help you please share with us example of your project that we will check and fix it for you.

Please feel free to contact us if you will have more questions.

Best regards
Pavel Teplitskiy

http://groupdocs.com
Your Document Collaboration APIs
Follow us on
LinkedIn, Twitter, Facebook and Google+
Our Other Venture –
Banckle – Your Customer Service APIs | Aspose – Your File Format APIs


#4

Hello,

Thank you for coming back. To resolve the issue and add GroupDocs.Viewer in to your project you should copy GroupDocs.Viewer.dll in to the folder which should be placed in the root of your project, for example “dependencies” folder. And after that please add reference to this dll.


Also in case that you need full guide for how to use GroupDocs.Viewer in your project please check these steps:


1 Right mouse button on the project and create new folder “dependencies”- http://prntscr.com/3ymg1e


2 Copy GroupDocs.Viewer.dll to the created folder

3 Right mouse button on the project again and select add reference - http://prntscr.com/3ymgd6


4 In the opened dialog click “Browse” and navigate to the copied GroupDocs.Viewer.dll


5 In the root of your project create new folder “testfiles” and copy in it all files which will be viewed in the Viewer.


6 Create new global class item - http://prntscr.com/3ymgz7


7 Add this code to the Global.asax:


7.1 To the imports section: Imports Groupdocs.Web.UI

7.2 To the Application_Start:

Viewer.SetRootStoragePath(Server.MapPath("~/testfiles/"))

Viewer.EnableFileListRequestHandling(True)


8 Create new Web form item - http://prntscr.com/3ymgoi


8.1 To the created Web form item add this code:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %>

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

<!DOCTYPE html>

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

<head runat="server">

<title></title>

<%= Viewer.CreateScriptLoadBlock().LoadJquery().LoadJqueryUi() %>

</head>

<body>

<div id='test' style='width: 1000px; height: 800px; overflow: auto; position: relative; margin-bottom: 20px; background-color: gray'></div>

<%= Viewer.ClientCode()

.TargetElementSelector("#test")

.FilePath("{file name to view}")

.EnableRightClickMenu(true)

.ShowThumbnails(true)

.OpenThumbnails(true)

.ZoomToFitWidth()

.Quality(100)

.ToString()

%>

</body>

</html>


9 In to the Web.config add this handlers:

9.1 In to the system.web section:


9.2 In to the system.webserver section:

That’s all, now you can run your project

Please feel free to contact us if you will have more questions.

Best regards
Pavel Teplitskiy

http://groupdocs.com
Your Document Collaboration APIs
Follow us on
LinkedIn, Twitter, Facebook and Google+
Our Other Venture –
Banckle – Your Customer Service APIs | Aspose – Your File Format APIs


#5

Hello Aravind,


We are sorry to hear that you have such issue. We cannot reproduce the situations as it is on the screenshot that you had provided, but it seems that there is some object that has name "viewer" besides GroupDocs.Viewer. This is Visual Basic.NET, so "viewer" and "Viewer" are the same names. Maybe this member is declared in the code-behind ("GlobalFV" class). Anyway, compiler "thinks" that "Viewer" is not a GroupDocs.Viewer but some other type. And this "another" type doesn't have a "CreateScriptLoadBlock" member.

In order to fix it use full names. Remove <%@ Import Namespace="Groupdocs.Web.UI" %> from the page and use the next code for placing GroupDocs.Viewer on the page:

Scripts including:

<%= Groupdocs.Web.UI.Viewer.CreateScriptLoadBlock().LoadJquery().LoadJqueryUi()%>

And Viewer itself:

<%= Groupdocs.Web.UI.Viewer.ClientCode().TargetElementSelector("#test").FilePath("document.doc") %>

Please feel free to contact us if you will have more questions.


#6
Hello GroupDocs
Thank u for ur reply,now it work,i have viewer.aspx page so it conflict,now work correctly



Regards
Aravind

#7

Hello Aravind,

Thanks for coming back in touch, we are glad that our suggestion was helpful for you.

If you will have more questions please feel free to contact us.