.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Use Silvelight Form as Edit page ClientContext.Current is null

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint


I've created a custom content type and set a xap as edit form and new form.

this edit/new form of course gets open in the classic SharePoint Dialog.

the problem I have is that the ClientContext.Current is null in this context (Silverlight in Dialog)

I get a context when I host this xap in the Silverligth Web Part

what's wrong ?

View Complete Post

More Related Resource Links

Custom Edit form - close modal dialog and navigate to page

Hi, I created one custom edit form for my document library, replaced default save and cancel buttons with input buttons and added the form action to them. Then I set my page as default edit form. When I click edit button, my custom form opens in modal pop up. When I try to save the item by clicking new save button, item gets saved but pop remains as it is. Now, I want the modal pop up to get closed and navigate to page other than the parent page with some parameters after I click save button. How can I achieve this? Thanks!!

edit form page loading is slow with more fields in foundation 2010


Hi friends,

I have recently noticed that ,my list edit form page load time is more compare to old version .

I have migrated my sharepoint site from wss3.0 to foundation 2010. I have a large list with 15,000 items and 43 fields.

My new item form is loading very quickly but edit form taking more than a minute. I tried with helath reports and firebug and yslow tools.

I didn't success with any reason. I request you to send me why it happening to the edit form page only

Out of 42 field 12 fields are lookup and I have field edit permissions enabled for different users.

Let me know what can I do to improve page load time for my list edit form.





SPContext.Current.Web.CurrentUser null in application page on 2008 r2 server

With my current situation I have:
a wss3 development environment on a 2003 R2 server
then a production 2008 r2 server.

For some reason on the 2008 server the SPContext.Current.Web.CurrentUser object is null for users who are site collection administrators but may not have permission to log into the server itself; however, on the 2003 R2 server the code works fine for those users.
When googling around, I had seen something about nt permissions on the bin folder sometimes being and issue until asp.net cache picks up the dll but this is a page in the _layouts directory and the code is in the .aspx page itself. It works fine for me as a system administrator on either machine.

Any suggestions? Thanks.

Null values doesnot show up in custom edit form in a drop down choice menu


Hello guys,

I have a problem. I don't know why custom edit form is behaving like that.

I have a choice drop down with values  " ","Yes","No". For custom  new form, I can insert null values and everything is working fine.

But coming to this custom edit form which I created.  While editing, if we set a value to null and submit the form. It is getting the "Yes" as the value. It is skipping the null value and placing the "Yes" value. I have kept the default value for choice drop down as " ".(null too).

I don't know why it is not showing null value. Do guys have any idea or if came across anything like this. Please help

Detecting Edit or Insert Page


I am coding a .cs file that handles the metadata for a particular table. I am putting a custom validation that allows me to update or insert only if the PubMedID is not already in the database. This would be easy except that the PMID should also be allowed to be null as some of the references in the database were not from PubMed. So i perform a query on the database to see if there is already an identical PMID in the database. This works great when using Insert. However, when using Edit, it does not. The PMID is already in the database because the one currently being edited has the same PMID!!! So I know exactly how to change my query etc. However, I do not know how to tell from inside this Edit/Insert agnostic page, which one it is being called from. Thanks for your help! 

Users getting logged out because HttpContext.Current is null


We've  been trying to fix this one for a couple years, and I'm just out of ideas, so any help is really appreciated!

We've got a fairly large, complex web application that uses Forms Authentication to authenticate users.  Throughout the application we store and retrieve information about users in the Session object, and in some cases in cookies.  In a couple places we check for the existence of the context, and if it's null we send the user back to the login page to re-establish the session. 

Just a quick run-down of this web app: C#, .NET 3.5, IIS 6, ASP.NET State Service to manage session

As for the session timer, we use our own home-grown timer, which is basically a client-side timer, which is backed up by a check to the SQL database to see when their last activity was.  This seems to work well for us.  It's not perfect, but it allows us to notify the user before the session times out, and allows us to be certain we're not logging a user out before their 60 minutes of inactivity is up.

What's happening is that certain users are being logged out after just a few minutes.  We've eliminated the timer as a cause and believe what's happening is the HttpContext.Current is null, so the user is logged out.  We do not know why the HttpContext.Current is null, and I underst

Page.FindControl Causing Null Reference Exception


Hi guys,

I developed a page in VWD 2008 and it works perfectly locally, but when I deployed it on the server every Page.FindControl() call is causing the NullReference Exception "Object reference not set to an instance of an object. " Can anyone help me out? Code is below


Mike Marshall

            For i As Integer = 1 To 10
                If (CType(Page.FindControl("last_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("first_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("dob_" & i), TextBox).Text.Length > 0) Then
                    Dim person_entry(7) As String
                    person_entry(0) = info_list.Count - 1
                    person_entry(1) = CType(Page.FindControl("last_" & i), TextBox).Text
                    person_entry(2) = CType(Page.FindControl("first_" & i), TextBox).Text
                    person_entry(3) = CType(Page.FindControl("dob_" & i), TextBox).Text
                    person_entry(4) = CType(Page.FindControl("appear_" & i), TextBox).Text
                    person_entry(5) = CType(Page.FindControl("mental_" & i), TextBox).Text
                    person_entry(6) = CType(Page.FindControl("behave_" & i), TextB

Knowing the event occured in user control in current page




      My web application has user control which uses third party controls called Devexpress controls. The user control is a menu  and is part of the Master page. It is placed there because this needs to be available in all the pages. My user controls raises a even on item clicked. Now, My question is that Is there any way to know that the event has occurred in page_load of the current page in which I am in?

Filter web parts in new form page of a list



I've created 2 custom lists. The 2nd list has a lookup column from the 1st list. In the new form page for this 2nd list, I've added the 1st list as a web part. Now, I want to connect the 2 web parts, but it's not available. Basically, what I wanted is that when I select an item on the lookup column, the webpart containing 1st list would show that item on the same page.

I think I'll need to use Sharepoint Designer to implement something like this, but just wanted to check if anyone has done something like this using browser only.



How to dynamically hide stock edit/display form?


How can I dynamically hide/show the stock edit or display form of a list item?

you do not have permission to do this operation. Whenever I try to edit a page in sharepoint designe


Hi There,

I keep getting the error message "you do not have permission to do this operation" in  sharepoint designer 2007 (WSS 3.0), whenever I try to edit a page in Sharepoint Designer.

I am a farm admin, site collection admin and site admin, after the error message I can click OK and enter the Administrator password which has the same priviliges as me and it thinks about it for 5 minutes then returns the same error, eventually after several hours it will allow me to save changes but it's about a 1 in 20 chance.

As it does save sometimes it would appear to me that somehow it is losing the connection or temporarily losing the credentials. Does anybody have a clue where I can start to find out a solution to this problem. I get the feeling that something is corrupted somewhere but I don't what to look for and where.

Any help, tips, ideas gratefully received.

Thanks in advance.


How to get current page file name?


I am trying to get the current page file name that i access to.
Lets say i am at test.aspx page, i want it to return me "test" file name.
I tried to use this.Page.toString(), it returned me "ASP.test_aspx" which is like half correct....
but i would like to get only "test".

2nd question, this.Page.toString() will always return me in a format of ASP.[filename]_[fileextention]?
If that's the case, maybe i can use splilt function to get the file name i want if there aren't any better solution than that.



click a button to print current window form

how can i click a button to print current window form? i don't know how to set and define something? anyone give me example for my reference   thanks.

error in MVC2 on empty string form fields which are required: "This property cannot be set to a null

In model I have:[DisplayName("ISBN")] [Required(ErrorMessage = "ISBN is required.")] [StringLength(50, ErrorMessage = "ISBN book must have max {1} chars.")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string isbn { get; set; }But when I submit form with empty field ISBN I have an error - ConstraintException: This property cannot be set to a null value.I have find that other people have the same problem and they say that debbugger in VS2010 works wrong - yes ?http://p2p.wrox.com/book-professional-asp-net-mvc-2/79788-constraintexception-unhandled-user-code.html#post259245http://efreedom.com/Question/1-3129080/Server-Side-Validation-REQUIRED-String-Property-MVC2-Entity-Framework-Workhttp://mvcmusicstore.codeplex.com/workitem/6604

"Only their own" allows users to edit, then shows access denied page

I am managing a WSS 3.0 portal.  I have created custom lists where a group has contribute permissions.  Under List Settings|Advanced Settings, when I set Edit Access to "Only their own" or "None", my test users can see the Edit Icon and the Edit Item menu option, and bring up the Edit Form.  When they click "OK", they get the Access Denied page.  My experience in that past is that they should not even been shown the option to edit, and they should get Access Denied if they somehow navigate to the EditForm.aspx page.  I even tested this on a brand new site, with three Links lists, each with different Edit Access Levels (All, None, Only their own).  I added one user with contribute permissions.  He had the same result: He could get all the way to EditForm.aspx, but got "Access Denied" when he submitted his changes.  What can I do to fix this?Christopher W. Douglas

create new custom list form in sharepoint designer and edit in browser

hi, i have created a new list using sharepoint designer 2007. now i inserted a custom list form to modify some field and add new ones. when i finished i will tight my new custom list to the custom form. what i want to know is. i see the status field in my new form. and i only want the status field to appear in the edit form for the one that has the permission to edit the status. then i tought of open the list in my browser and go to the list settings. but what i notice is i dont see my fields i have modified in sharepiont designer in the columns section i only see the ones from the existing list. my question is how can i hide the status field in the new item form that it only show in the edit form. and how do i get my new form in the column section so the end user can add more fields if they want without using sharepointdesigner thnx
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend