Tuesday, November 24, 2009

Embedding JavaScript in Resources

To be able to access the JavaScript in the embedded resource, you need to take two steps: Declare the resource in the control's class file or in the AssemblyInfo.cs using the syntax:

[assembly: WebResource("{namespace}.{filename}", "{content-type}")]
ex :-
[assembly: WebResource("ControlLibrary.script.js", "text/javascript")]

Now we can access the file through the WebResource.axd HTTP handler, then we may retrieve the actual file from the resources of the project's assembly by calling the method GetWebResourceUrl(type, webresource).

protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
this.Page.ClientScript.RegisterClientScriptInclude("NameForScript",
this.Page.ClientScript.GetWebResourceUrl(this.GetType(),
"ControlLibrary.Script.js"));
}

Wednesday, October 21, 2009

Getting started with ADO.NET Entity Framework in .NET 3.5

ADO.NET Entity Framework is included with .NET Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1. Please make sure you have and Visual Studio 2008 Service Pack 1 installed in your system.

Refer this link to Know how to use .NET Entity Framework

Monday, September 14, 2009

Silverlight + Sharepoint 2007 Web Part

1) Install Silverlight 2.0
2)
Make sure you have done all entries required for Silverlight 2.0 in web.config file of that site.(All entries for Ajax)
3) Add ScriptManager into web part before render silverlight component
4) Add following additional entry in assemblies section of web.config<add assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
5)Add System.Web.Silverlight.dll in Global Assembly Cache.This dll is available in following path C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server

Monday, June 22, 2009

How to stop prompting for UserName Password when I click Report Server Web Service URLs

Based on my understandings, when you access report server or report manager, you get a login prompt multiple times and eventually you get a blank screen. If so, I suggest to go through the following article, it will tell us how to solve this issue.
http://blogs.msdn.com/lukaszp/archive/2008/03/26/solving-the-reporting-services-login-issue-in-the-february-ctp-of-sql-server-2008.aspx
Or when you get a prompt, please type the username for that server machine and select the checkbox(remember me next time). Then we don't need to type the username multiple times.