.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> SharePoint >> Post New Question Subscribe to Interview Questions

What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?

Posted By :Faizal     Posted Date :August 22, 2010    Points :10   Category :SharePoint 
ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.


You can also find related Interview Question to What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?  below: 


What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?

  


ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.

(More...)

Where do you deploy the additional files used in your webpart, like css or javascript files, and how do you use them in your WebPart?

  
Ans. You can deploy the css or javascript files in _layouts folder in SharePoint's 12 hive. To use them in your webpart, you need to first register them to your webpart page and then specify a virtual path for the file for e.g. _layouts\MyCSS.css See Code examples at Using External Javascript, CSS or Image File in a WebPart. (More...)



Q. Where do you deploy the additional files used in your webpart, like css or javascript files, and how do you use them in your WebPart?

  

Ans. You can deploy the css or javascript files in _layouts folder in SharePoint's 12 hive. To use them in your webpart, you need to first register them to your webpart page and then specify a virtual path for the file for e.g. _layouts\MyCSS.css See Code examples at Using External Javascript, CSS or Image File in a WebPart.
(More...)

How would you deploy WebPart Using Windows PowerShell?

  
At the Windows PowerShell command prompt (PS C:\>), type the below command :

Install -SPWebPartPack -LiteralPath "FullPathofCabFile" -Name "Nameof WebPart" (More...)

Where do you deploy the additional files used in your webpart, like css or javascript files, and how do you use them in your WebPart?

  
You can deploy the css or javascript files in _layouts folder in SharePoint's 12 hive (SharePoint2007)/14 hive (SharePoint2010)/ 15 hive(SharePoint2013). To use them in your webpart, you need to first register them to your webpart page and then specify a virtual path for the file for e.g. _layouts\MyCSS.css . (More...)

What options are available to deploy my .NET applications?

  
The .NET Framework simplifies deployment by making zero-impact install and XCOPY deployment of applications feasible. Because all requests are resolved first to the private application directory, simply copying an application's directory files to disk is all that is needed to run the application. No registration is required.
This scenario is particularly compelling for Web applications, Web Services, and self-contained desktop applications. However, there are scenarios where XCOPY is not sufficient as a distribution mechanism. An example is when the application has little private code and relies on the availability of shared assemblies, or when the application is not locally installed (but rather downloaded on demand). For these cases, the .NET Framework provides extensive code download services and integration with the Windows Installer. The code download support provided by the .NET Framework offers several advantages over current platforms, including incremental download, code access security (no more Authenticode dialogs), and application isolation (code downloaded on behalf of one application doesn't affect other applications). The Windows Installer is another powerful deployment mechanism available to .NET applications. All of the features of Windows Installer, including publishing, advertisement, and application repair will be available to .NET applications in Windows Installer 1.5. (More...)

I have written an assembly that I want to use in more than one application. Where do I deploy it?

  
Assemblies that are to be used by multiple applications (for example, shared assemblies) are deployed to the global assembly cache. In the prerelease and Beta builds, use the /i option to the Alink SDK tool to install an assembly into the cache:
al /i:myDll.dll
A future version of the Windows Installer will be able to install assemblies into the global assembly cache. (More...)

what are value types and reference types?

  
Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort
Value types are stored in the Stack
Reference type - class, delegate, interface, object, string
Reference types are stored in the Heap (More...)

What are Value types and Reference types?

  
Value types directly contain their data which are either allocated on the stack or allocated in-line in a structure. Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. Variables that are value types each have their own copy of the data, and therefore operations on one variable do not affect other variables. Variables that are reference types can refer to the same object; therefore, operations on one variable can affect the same object referred to by another variable. All types derive from the System.Object base type. (More...)

What is Reference counting in COM ?

  
Reference counting is a memory management technique used to count how many times an object has a pointer referring to it. The first time it is created, the reference count is set to one. When the last reference to the object is nulled, the reference count is set to zero and the object is deleted. Care must be exercised to prevent a context switch from changing the reference count at the time of deletion. In the methods that follow, the syntax is shortened to keep the scope of the discussion brief and manageable. (More...)

How can you reference current thread of the method ?

  
"Thread.CurrentThread" refers to the current thread running in the method."CurrentThread" is a public static property. (More...)

How do I call a member method and pass a primitive type (Value Type) by reference?

  
Use the ref keyword when declaring the parameter of the method, for example:

public bool GetValue( ref int returnValue );

This will pass the numeric by reference.You can modify the value of returnValue within the body of GetValue and it will persist when the method call returns. (More...)

Value Types & Reference Types

  

In C# data types are classified into two categories-value types and reference types. The difference between value type and reference type is that the variables of value type are allocated on stack, whereas, variables of reference type are allocated on heap. Secondly, the variable of value type contains data, whereas, variable of reference type contains the address of the memory location where data of that variable is stored. Among built-in data types, all the types of integers, floats, doubles, decimals, chars and bools are value types, whereas, the string and object are reference types. Among user-defined data types, classes, interfaces and delegates are reference types, whereas, structure is a value type.

Memory allocated for objects of value types is freed when they go out of scope. Memory allocated for objects of reference types is freed when they are no more being referenced.

Both the value and reference types have advantages and disadvantages. Memory allocation on stack is faster than that on heap. So, if the object is small, we must use a value type rather than a reference type. On the other hand, if the object is big we must avoid declaring it as a value type. Because, if we assign it to any other object, its whole contents would get copied, consuming additional memory. As against this, in case of a reference type only the reference is copied rather than the whole object
(More...)

Value type & reference types difference? Example from .NET. Integer & struct are value types or reference types in .NET?

  
Most programming languages provide builtin data types, such as integers and floatingpointnumbers, that are copied when they are passed as arguments (that is, they are passed by value). In the .NET Framework, these are called value types. The runtime

supports two kinds of value types:
· Builtin
value types
The .NET Framework defines builtin
value types, such as System.Int32 and
System.Boolean, which correspond and are identical to primitive data types
used by programming languages.
· Userdefined
value types
Your language will provide ways to define your own value types, which derive from System.ValueType. If you want to define a type representing a value that is small, such as a complex number (using two floatingpoint numbers),
you might choose to define it as a value type because you can pass the value type efficiently by value. If the type you are defining would be more efficiently passed by reference, you should define it as a class instead.

Variables of reference types, referred to as objects, store references to the actual data. This following are the reference types:
· class
· interface
· delegate
This following are the builtin
reference types:
· object (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend