adsense

Wednesday, September 26, 2012

Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load

You suddenly might end up getting above message when trying to run your ASP.NET project. There various solutions given in forums and only after changing the web config as follows worked for me!

  <httpHandlers> 
 
 <remove verb="*" path="*.asmx"/>
 <add verb="*" path="*.asmx"  
validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
 <add verb="*" path="*_AppService.axd"  
validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
 <add verb="GET,HEAD" path="ScriptResource.axd"  
validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
 
</httpHandlers>
 



reference 
http://forums.asp.net/t/1243449.aspx#2291128
 
cheers
Samitha 

Monday, September 24, 2012

Silverlight Spy

This is a free tool that lets you explore the Silverlight application just by entering the url to it. This tool will make developer's life much easier...!!!

Download

More details about this can be found here.

Cheers
Samitha

Thursday, September 20, 2012

browser back button issue after logout

Most of us would have experienced that after logging out from a typical web based asp.net application, user can use the back button to go back to previous page. There a few ways to overcome this issue. Following article gives you some tips on this

http://www.codeproject.com/Tips/135121/Browser-back-button-issue-after-logout

 

Regards

Samitha

Thursday, September 13, 2012

send mms from sql server (only within Sri Lanka)

Most of us know that we  can send MMS messages  using gmail. For the sake of completion I ll list down the basic steps to achieve it.


1)  Compose a new mail. In the to box type your mobile number (i.e. 009477xxxxxxx@mms.dialog.lk for Dialog, 009471xxxxxxx@mms.mobitel.lk for Mobitel). I haven't tried this with the other service providers. 

2) Type in you message and send it as you are sending a normal email.

I have taken this to a one more step further by using this concept to send mms messages from SQL Server dbmail. Follow these steps


1) Create a mail profile for your gmail account using Database Mail wizard. Specify your maill account setting as follows.



2) Call the created profile inside your stored procedure ass follows.

EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'sendmail',
    @recipients = '
009477xxxxxxx@mms.dialog.lk',
    @body = 'Congrats for sending first MMS..!!.',
    @subject = 'Test MMS' ;


It will take some time to deliver sms  to the recipient. Please note that the recipients phone must support MMS for reading this message.  You can use this method to send a simple SMS without being bothered about buying a SMS gateway. 



Note: If you receive the "gmail smtp error 5.7.0" message when sending mail, try changing SMTP from smtp.gmail.com to smtp.googlemail.com 

Cheers
Happy Coding
Samitha

Tuesday, September 11, 2012

asp.net Menu flickering

When you are using a asp.net menu when any postback occurs and the page gets rendered again the menu "flickers" for a moment. When this happens the whole menu items will be displayed for some time.

As following post suggests setting display:none in #menu ul li ul solved the menu flicker issue for me .

http://stackoverflow.com/questions/3240873/how-to-get-rid-of-ugly-aspmenu-flickering

Edit
If the above solution  doesn't work try setting the RenderingMode ="Table"  in the Menu .

Cheers
samitha

Sunday, September 9, 2012

Linq check null or empty string

You can use following ways to check if a field is null or empty in Linq

1)

var objField=
from item in tabelName
where item.field== null || item.field.Equals(string.Empty)
select item;

2)
var objField=
from item in tabelName
where string.IsNullOrEmpty(item.field)
select item;

cheers
samitha