About the author

Vijay Kodali
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Unable to update the EntitySet '' because it has a DefiningQuery and no element exists in the element to support the current operation.

Error Message:

 Unable to update the EntitySet 'TableName' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.

 

Solution:

Make sure that table Primary key column. If not add one, that should fix this error


Posted by vijay on Saturday, January 22, 2011 5:01 PM
Permalink | Comments (0) | Post RSSRSS comment feed

URL length restrictions in SharePoint Foundation 2010

       URL part

              Example

      Protocol

http://

   Server name

www.contoso.com/

  Folder or file path

sites/marketing/documents/Shared%20Documents/Promotion/

     File name

Some%20File.xlsx

  • 260 Unicode (UTF-16) code units – the characters in a full file path, not including a domain/server name.
  • 256 Unicode (UTF-16) code units – the characters in a full folder path, not including the file name and the domain/server name.
  • 128 Unicode (UTF-16) code units - characters in a path component, that is, a file or folder name.
  • 260 Unicode (UTF-16) code units – the characters in a full path, including a domain/server name for use with Office clients.
  • 256 Unicode (UTF-16) code units – the characters in a full path including the domain/server name, for use with Active X controls.

The above limitations apply to the total length of the URL path to a folder or a file in SharePoint Foundation 2010 but not to the length of any parameters. Also, these limitations apply only to un-encoded URLs, not to encoded URLs. There is no limit to encoded URLs in SharePoint Foundation 2010

Reference: http://technet.microsoft.com/en-us/library/ff919562.aspx


Posted by vijay on Friday, October 8, 2010 9:22 PM
Permalink | Comments (0) | Post RSSRSS comment feed

AsyncFileUpload events with Update Panel

Problem:

 

Last week I came across this bug (?) with AsyncFileUpload control in updatepanel. The control is not firing OnUploadedComplete server side event when it’s in updatepanel.

 

Solution:

 

After doing some research on this issue, came across these solutions.

 

1)     Add another AsyncFileUpload control on the page and set its’ style to display:none; 

 

       

<div style="display: none;">

  <cc1:AsyncFileUpload ID="AsyncFileUpload1" runat="server" />

</div>

 

 

2)     Another workaround is to add the following attributes to the <form> tag of the page..

enctype="multipart/form-data" method="post"

 

 

Both the solutions are working fine.

 

 

Thanks to obout_teo and MikeMelendez of Asp.Net forums


Categories: AJAX | ASP.Net 3.5
Posted by Vijay on Monday, September 20, 2010 6:22 PM
Permalink | Comments (5) | Post RSSRSS comment feed

SharePoint repeatedly prompts for login credentials

Symptoms:

After you enter credentials on SharePoint site login prompt, you will be thrown the login prompt repeatedly despite providing the right credentials.

Cause:

This issue occurs with default security settings of IE7 in windows server environment. The settings include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails.

It can also happen for users that are behind a secured network and browser settings are controlled by administrator.

Solution:

To work-around this problem, users need to turn off Integrated Windows Authentication in Internet Explorer.

  1. In Internet Explorer, click on the Tools button, then choose Internet Options
  2. Click on the advanced tab
  3. Clear the Enable Integrated Windows Authentication option (In Security section) and Click “OK”
  4. Close and restart Internet Explorer.

If the problem persists, you may need to manually add the team Web site to the list of trusted intranet sites. To do this, complete the following steps:

  1. On the Internet Explorer toolbar, click Tools, and then click Internet Options.
  2. In the Internet Options dialog box, click the Security tab, and then select Local intranet.
  3. Click Sites, and then click Advanced.
  4. Type the URL of the team Web site in the Add this Web site to the zone box, click Add, and then click OK.

Posted by vijay on Friday, August 27, 2010 10:01 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Disabled button not grayed out in Firefox and Chrome

When button is disabled, it’s not-clickable in all browsers. However in Firefox and Chrome, the button looks enabled, though the user cannot click it.

Reason:

From W3Scholl, "Enabled" Property isn't standard property of XHTML 4.

Solution:

You can modify the way they look with CSS

button[disabled] { 
 color:Grey;
/* Add other  styles here for disable button */ 
} 

Posted by vijay on Thursday, August 12, 2010 9:08 PM
Permalink | Comments (3) | Post RSSRSS comment feed

Developer Dashboard SharePoint 2010

Enable Developer Dashboard via stsadm :

stsadm -o setproperty -pn developer-dashboard -pv ondemand

Developer Dashboard

To disable Developer Dashboard:

stsadm -o setproperty -pn developer-dashboard -pv off


Categories: SharePoint2010
Posted by Vijay on Thursday, June 10, 2010 6:03 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Alert user before session timeout

Here is a quick & dirty trick to alert users on session timeout. This is not a perfect solution. But it will give reader an idea to work on...

Some facts before we start:

Session doesn't end

  • When the user closes his browser
  • When the user navigates away from your page
  • When user connection lost.

Session ends, when the server hasn't gotten a request from the user in a specific time (Session timeout value).

In this solution, I am using ajaxtoolkit’s modalpopupextender control to alert user about expiring session.

Each time a page is rendered back to the client, I am injecting JavaScript that will show modalpopup two minutes before session timeout. I am passing the session expiry value to the client side java script. This will execute a countdown, and at the end display the Popup.

I added modalpopupextender to the page and set its target control id to a panel. That panel contains alert message and two buttons.

clip_image002

The Page_Load code looks like this.

clip_image004

I added two java script functions, one for showing alert message and second one is for hiding that message.

Here are javascript functions

clip_image006

That’s it. Run the application and it will check 2 minutes before the timeout and provide user the option to "slide" the session. If user clicks “OK” it will refresh page, which in turn will slide the session. If user clicks “Cancel” the popup will hide.

clip_image008

 

You can improve this code on each step. Like for example, to renew session you don’t have to refresh the page. You can just call web service from client side etc.

If you have any questions, leave a comment.


Posted by Vijay on Thursday, May 20, 2010 8:51 PM
Permalink | Comments (16) | Post RSSRSS comment feed

Asp.net session on browser close

How to capture logoff time when user closes browser?

Or

How to end user session when browser closed?

These are some of the frequently asked questions in asp.net forums.

In this post I'll show you how to do this when you're building an ASP.NET web application.

Before we start, one fact:

There is no full-proof technique to catch the browser close event for 100% of time. The trouble lies in the stateless nature of HTTP. The Web server is out of the picture as soon as it finishes sending the page content to the client. After that, all you can rely on is a client side script. Unfortunately, there is no reliable client side event for browser close.

Solution:

The first thing you need to do is create the web service. I've added web service and named it AsynchronousSave.asmx. 

 Open Dialog

Make this web service accessible from Script, by setting class qualified with the ScriptServiceAttribute attribute... 

clip_image004

Add a method (SaveLogOffTime) marked with [WebMethod] attribute. This method simply accepts UserId as a string variable and writes that value and logoff time to text file. But you can pass as many variables as required. You can then use this information for many purposes.

clip_image006

To end user session, you can just call Session.Abandon() in the above web method.

To enable web service to be called from page’s client side code, add script manager to page. Here i am adding to SessionTest.aspx page

clip_image008

When the user closes the browser, onbeforeunload event fires on the client side. Our final step is adding a java script function to that event, which makes web service calls. The code is simple but effective

clip_image010

My Code

HTML:( SessionTest.aspx )

clip_image012

C#:( SessionTest.aspx.cs )

clip_image014

That’s’ it. Run the application and after browser close, open the text file to see the log off time.

clip_image016

The above code works well in IE 7/8. If you have any questions, leave a comment.


Posted by vijay on Thursday, April 29, 2010 6:09 PM
Permalink | Comments (22) | Post RSSRSS comment feed

To access local IIS Web sites, you must install the following IIS components: Internet Information Services IIS 6 Metabase and IIS 6 Configuration Compatibility

If you are getting following error after converting asp.net project to latest version..

To access local IIS Web sites, you must install the following IIS components: Internet Information Services IIS 6 Metabase and IIS 6 Configuration Compatibility

Try this solution:

open Control Panel, click Programs and Features

WindowsFeatures

Expand Web Management Tools, expand IIS 6 Management Compatibility, and then select the IIS 6 Metabase and IIS 6 configuration compatibility check box.

IIS 6 Metabase and IIS 6 configuration compatibility


Expand World Wide Web Services, expand Application Development Features, and then select the ASP.NET check box.

aspNet

 

To enable Visual Studio to debug applications, you must configure IIS 7.0 with the Windows Authentication module. Expand World Wide Web Services, expand Security, and then select the Windows Authentication check box.

 

WindowdsAuthentication

Reference: http://msdn.microsoft.com/en-us/library/aa964620.aspx


Categories: ASP.NET | ASP.Net 3.5 | Windows 7
Posted by vijay on Thursday, April 8, 2010 3:01 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Visual Studio 2008 short cuts

I know there are many posts dedicated to this topic. For example, Sara Ford posted about 290 shortcuts on her blog. Check Zain Naboulsi blog for VS 2010 tips.

But it’s almost impossible to use all of them on daily basis. And further most of them are really not that useful. Here are 10 of my favorite Visual Studio keyboard shortcuts, ones I use most..

1) Double TAB

If you know snippet key name, write and click double Tab.

For example: Write

If

and then click tab key twice to get

if (true)
{
    
}

Similarly write try then click tab key twice to get

try
{

}
catch (Exception)
{
    
    throw;
}

2) CTRL + TAB to switch open windows in visual studio

3) CTRL+K and CTRL+D to format code

4) CTRL+SHIFT+V to cycle through clipboard

5) SHIFT+ALT+ENTER for full screen mode

6) F7 to switch between code behind and .aspx files

7) CTRL+H or CTRL+SHIFT+H for find and replace

8) Ctrl+F5 to run without debugging. F5 only will run in debugging mode

    F11 to step into a method. SHIFT+F11 to step out of a method. F10 to step over a method.

9) F9 toggle and un-toggle breakpoints

10)F12 to go to definition

 

What’s your favorite Visual Studio keyboard shortcut/hidden feature/trick..?


Tags:
Posted by vijay on Thursday, March 4, 2010 9:42 PM
Permalink | Comments (1) | Post RSSRSS comment feed