April 2011 - Posts

Migrating Asp.net WebSite to Azure

First of all you’ve got to convert your asp.net website to asp.net web application site.

Steps to do this

  • Make new Web application Project on your Azure Cloud
  • Copy paste all your aspx files to the New WebApplicationProject
  • Right click project, click Convert to web Application, this will generate the designer.cs file and convert all behind code file to compile
  • For your app_code change all the .cs Files , BuildAction-> Compile
  • If you have WebReference, you only need the WSDL to generate the Proxy class. because the Strucutre is different on asp.net web application project, you might want to generate it again. Right Click Add service reference->Advance->AddWebReference->Point to your WSDL name it the Same as your previous one,Change SoapClient to only the object Name
  • If you have Problems on using Profile, since there is no Strong type generated by Asp.net web application. use this generator , How to use it. You don’t have profilecommon, just use the Profile class generated. you can access value on asp.net webapplication on httpcontext.current.Profile.GetPropertyValue.
  • After successful build, than add it to azure, Righclick Role->add web role in solution

It’s time to deploy..

Share this post: | | | |
Posted by cipto with no comments

Cookie Following Session Expired Time

Many on our website use Own cookie and Session.

Now after you build those redirect to login when cookie/session expired. how can you tell both expired? it’s not on the exact time,

beside session is always recycle and manage by asp.net worker. and if you close your browser page, the session just washed out but the cookie is not

and then you have it a partial site, partial function.

the solution is very simple, ever wonder why if you see the cookie, like on firecookie. the Cookie Expires said like “Session”. meaning it’s a “Non-Persistent Cookie”

you need to set the Expired of cookie the same as the Session to have the same integrated result on your site

how to do it? simple do not set the Expired to Future Time

“If you do not set the cookie's expiration, the cookie is created but it is not stored on the user's hard disk. Instead, the cookie is maintained as part of the user's session information. When the user closes the browser, the cookie is discarded. A non-persistent cookie like this is useful for information that needs to be stored for only a short time or that for security reasons should not be written to disk on the client computer. For example, non-persistent cookies are useful if the user is working on a public computer, where you do not want to write the cookie to disk” Detail

Share this post: | | | |
Posted by cipto with no comments

Upgrading to JQuery 1.5.x

IE9 is now become the source of conflict once again.

some things just don’t run on IE9, and jQuery 1.5.x is supporting IE9.

I’ve tested on simple case like on text area displaying characters left.

on IE9:

if we do it on jquery.text or HTML prior to version 1.5.x it’s odd or addEventlistener, if you type in fast enough it’s like a lag.

with 1.5.x it’s running smoothly.

I’ve tried couple of things like oninput event, onchange (on blur will update, but still lag/not updating when fast typing)

so the 1.5.x solve it. but not the plugin which still use old jquery. gotta go deep down enough

jQuery ajax is Changed

jQUery.GetJSON is changed the expected data type is jSONP,

it will break the js, so i changed to $.get and datatype=’html’

and Eval on responseText

Can we run Both version? like jQuery 1.3.2 /1.4  with the latest one 1.5?

Yes we can. we can use noConflict.

Include both version files

add the noconflict line on 1.5 js.

var myJQ15=jQuery.noConflict(true);

and when you want to use 1.5 one, use myJQ15.[method]


Share this post: | | | |
Posted by cipto with no comments