Archive

Posts Tagged ‘ASP.NET’

Error updating JScript IntelliSense: Object doesn’t support this property or method @ 2139:1

May 8th, 2009 Patrick 12 comments

Today I am trying out JQuery on Visual Studio 2008 for the first time. I go to the website at www.jquery.com and downloaded the library as well as the document for Visual Studio.

So I imported the JQuery library into my VS project

image

But when I want to try to the intellisense, I notice it is not working!! It should be able to recognize the famous $!!

image

Then I realize at the bottom of the VS IDE, there is an error message -

Warning    1    Error updating JScript IntelliSense: D:\workspace\Projects\JQuerySample\JQuerySample\scripts\jquery-1.3.2.js: Object doesn’t support this property or method @ 2139:1    D:\workspace\Projects\JQuerySample\JQuerySample\Default.aspx    1    1    JQuerySample

image

But this is not a bug inside the JQuery library itself. So I went back to scottgu’s blog post about on JQuery I notice something very difference with his library (besides the fact that he is using version 1.2.6).

I notice mine has got an extra number 2 at the end of vsdoc there. So I go back to the Google code side where I downloaded the file and I found out en they release a new vsdoc file to replace the exisiting deplecated one, they ‘tangan gatal’ change the name to jquery-1.3.2-vsdoc2.js. VS Interllisense only programmed to regconized [Javascript file name]-vsdoc.js without the 2 at the back there.

image

That vsdoc2 is the cause of the problem here! Just rename it to jquery-1.3.2-vsdoc.js and you got JQuery Intellisense working!

image

Categories: Uncategorized Tags: ,

Slides and documents on Devtalk 10 Apr 09

April 11th, 2009 Patrick No comments

Go here to download the files

Categories: Uncategorized Tags: , ,

LINQ to SQL and SQL Server Session State - Unable to serialize the session state

February 27th, 2009 Patrick No comments

Just realize one problem with LINQ to SQL

image

Unable to serialize the session state. In ‘StateServer’ and ‘SQLServer’ mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in ‘Custom’ mode.

When you have your ASP.NET session state stored in SQL Server, when you put any instance of your LINQ to SQL object into the session, you will hit by the about stated error.

I am still working on a fix for this. Will post the solution here once I found it.

Categories: Uncategorized Tags: ,

SQL Server named pipes error has nothing to do with the pipe

December 4th, 2008 Patrick No comments

I got a ASP.NET project with a integrated SQL Express database in to App_data folder like below

 image

When I click on F5 into debug mode and I try out some database operation, I got hit by the following error message.

Connection Error: (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.

Peek into SQL Server Configuration Manager and I see that Named Pipes is enable

image

So what is wrong with it? My network is OK

image

After searching the web I realized that SQL Server Agent service got disabled and it can cause problem with database in App_data folder. Open up the Services MMC and confirmed this.

image

So I enabled the SQL Server Agent service and got it started and my ASP.NET can functions per normal. :)

No guarantee it will work for your scenario though.

Default to Edit mode in ASP.NET 3.5 ListView

December 1st, 2008 Patrick No comments

ListView control gives you the flexibility of control the layout of your form. But when it comes to setting a Edit page using ListView such as the one for DetailView, you will realize it does not come with DefaultMode. For ListView you use the EditIndex property to set to something then the Edit view will be rendered by default.

<asp:ListView ID="ListView1" runat="server"
                DataSourceID="ContactInfoDataSource" EditIndex="0" >

Note that EditIndex is zero based, below is the explanation from MSDN

You can use the EditIndex property to programmatically specify or determine which item in a ListView control to edit. When this property is set to the index of an item in the control, that item is displayed in edit mode. In edit mode, the item is rendered by using the EditItemTemplate template instead of the ItemTemplate template. You can populate the EditItemTemplate with data-bound controls to enable users to modify values for the item. To switch from edit mode to display mode, set this property to -1.

Categories: Uncategorized Tags:

FCKEditor themed aspnet error in file browser

November 22nd, 2008 Patrick No comments

According to the post here, If you are greeted with the following error when trying to upload files using the file manager:

Using themed css files requires a header control on the page. (e.g. <head runat="server" />).

You don’t need aspnet themes within the fckeditor folder, so simply add a web.config file in the folder, with the following content:

<configuration>

   <system.web>

      <pages styleSheetTheme=""> </pages>

   </system.web>

</configuration>

That would not work because it miss out another setting which is the ‘theme’ setting, so the correct settings would be as below:

<configuration>

   <system.web>

       <pages theme="" styleSheetTheme=""></pages>

   </system.web>

</configuration>

For FCKEditor, this web.config file need to be located in the same folder as the upload.aspx file.

I believe not just FCKEditor but also most of the ASP.NET project out there.

Categories: Uncategorized Tags:

Free MS Press books

November 19th, 2008 Patrick No comments

Psst… if you looking to learn more about LINQ, ASP.NET 3.5, Silverlight 2 or SQL Server 2008, check out this website where you can download the books for free. :)

ms_asp_net_cvrms_linq_cvr ms_silverlight_cvr

Free downloadable e-book offer- Introducing Microsoft Silverlight 2

ms_sql_srv_cvr

Free download- “Introducing SQL Server 2008” e-book offer

Categories: Uncategorized Tags: , , ,

How to deploy a WCF web service project onto IIS6/7

October 15th, 2008 Patrick No comments

clip_image002

In your webservice project, you have PrecompiledWeb folder, this folder contain the web service project in compiled form. Copy the content of the PrecompiledWeb, which is the CustomXmlService folder in this case to c:\inetpub\wwwroot

clip_image004

Now the folder is a website in the web server (but without the ability to run .NET code) so go to your IIS manager console to make this website to a web application. In the console you will see that you newly copied folder does not have a globe icon.

clip_image006

You can see the website in your Default Web Site, in IIS7 right click and select Convert to Application.

clip_image008

Still inside IIS7, a new window will pops up, click OK to accept the settings.

clip_image010

For IIS6 right click to open up the property page of the website

image

A new window will pops up, showing the default Directory tab

image

What you need to do is to click on the Create button on the lower half of the window

image

Click OK if you are not changing the application pool or execute permissions. Leave the permission at Scripts only.

To test out the web service, open it inside browser and the service description will come out.

clip_image012

In Visual Studio client project, delete your project Service Reference and add a new one pointing to this deployed web site.

clip_image014

Categories: Uncategorized Tags: , ,

Dynamic Languages coming to ASP.NET 3.5

September 27th, 2008 Patrick No comments

Microsoft ASP.NET Team released a preview of dynamic languages support for ASP.NET 3.5 in Codeplex. That means languages like IronPython and IronRuby can be used to code ASP.NET pages, for example below is your ASPX page

<form id="form1" runat="server">
<div>
    Enter your name:<br />
    <asp:TextBox ID="TextBox1" runat="server">
    </asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Button"
        OnClick="Button1_Click"/><br />
    <br />
    <asp:Label ID="Label1" runat="server" Text="Label">
    </asp:Label>
    <br />
</div>
</form>

You can have a Python code behind page for the Button1_Click event

<script runat="server">
def Page_Load(sender, e):
    if not IsPostBack:
        Label1.Text = "...Your name here..."

def Button1_Click(sender, e):
    Label1.Text = Textbox1.Text
</script>

Do download from Codeplex and have fun with it.

Categories: Uncategorized Tags:

First Windows Server 2008 hosting in Malaysia

June 14th, 2008 Patrick No comments

Exabytes just row out their WS2008 hosting here. It comes with ASP.NET 3.5, PHP and lots of goodies. Check out the affordable package here.

Basically why you want to upgrade your website to Windows Server 2008? Besides taking advantage of ASP.NET 3.5 features, it’s also because of Internet Information Server (IIS) 7.0 modular architecture. Go here for more info.

Categories: Uncategorized Tags: , , ,