Error while navigating the page to another page - sharepoint-2010

I am trying to redirect page on Button click of infopath form using the below code:
HttpContext.Current.Response.Redirect("http://www.google.com", true);
But i am getting this error:
"Object reference not set to an instance of an object."

Does it help you ?
HttpContext.Current.Response.Redirect("http://www.google.com", false);
Take a look here,
http://mfawazsp.blogspot.in/2010/02/problem-with-responseredirect-in.html
or/and this,
Need inputs for logic for Codebehind in Infopath Button
or/and this,
http://social.technet.microsoft.com/Forums/sk/sharepoint2010programming/thread/16c7f7c5-545e-4375-b093-91da23041624

Related

IBM Domino custom login form load issue

I created domcfg db on my server, made a copy of $$LoginUserForm, customize it and set proper mapping. After all those operations i am able to modify my form as i wish, but ...
All the content, which is located below the login form (i didn't change it - only modify css) - doesn't render. Here is image:
All html code, which is located above table - is loaded, but below the table - whatever i'm adding - nothing is loading below the login form. What can be wrong with this?
The Sign In button closes the form. So comment out the Sign In button. You then need to add your own button and can then add more content below it.
Here's an example of a OneUI login form:
Moving submit below the form doesn't help, so i used dirty trick. Maybe for someone it will be helpful.
add jquery to header
add custom script like:
var content = "%your content%"
$( document ).ready(function() {
$( "form" ).append(content)
});

SharePoint: SPField.FieldRenderingControl does not render if the list is from another site

I have a custom New/Edit form that renders the edit controls using the FieldRendering control property of the fields. When the list and form are at the first level subsite (RootSite/SubSite1) of a SharePoint site collection. It works just fine.
When I try to use the same code to render the form in another first level subsite (RootSite/SubSite2) of the site collection, a sibling of the first site, the edit controls do not render. I have the code in (RootSite/Subsite2) and the list is still in (RootSite/SubSite1). I got a hint that RootFolder parameter might help but that did not work out. Any Ideas?
Thanks
I this case you can open the root site as follows:
using (SPSite oSPsite = new SPSite(SPContext.Current.Site.RootWeb.Url))
{
using (SPWeb oSPWeb = oSPsite.OpenWeb())
{

How do I modify Login page submit to call my custom function before the normal flow in Sharepoint 2010

I want to modify the login page of Sharepoint 2010 to change the normal flow during page submit. I want my custom function to be called, Validate it and go to actual submition of the page based on the validation result.
I have tried calling my custom function using onclientclick in the "asp: Button" tag. The custom function gets invoked, but I am unable to make the flow complete by sumbitting the login page. Once the custom function gets executed, the whole execution is stopped.
Please help me in solving it.
Thanks in advance.
I solved it my self. As mentioned I had added an extra submit button. SO when a user clicks the 'Sign In' button the custom function is called. On its success I made the original asp:button to click.

Having codebehind for Custom .aspx page in sandbox solution

I am having working with sandbox solution. i have one .aspx page in my solution and i have placed one button tag in that page, i need to write server side code for that button. But it is showing "The event handler 'OnClick' is not allowed in this page." . Does codebehind is not allowed in sandbox solution. Or indirectly how can i write my c# code for that button.
I know we can do it by creating one webpart and show that webpart in page using "WebPartPages:SPUserCodeWebPart" tag . But i want to confirm whether we can write codebehind for an asp page in some way or not.
Without changing the web.config file (which would not be recommended in this case), inline code or code behind files are not supported outside of the layouts folder (which you cannot deploy to with a sandbox solution).
However, you should be able to create a class and then set the inherits attribute to point to that class, instead of referring to the class in a code behind file.

Use global.asax to trigger event on master.page to show application errors

I would like to use my AJAX-enabled VB web application's gloabal.asax application_error sub to manage all my error handling. However, instead of just sending the user to an error page, I would like to show the error message to the user via a modalpopupextender control located inside the site's master.page.
Can someone please explain in detail how this can be accomplished? I have managed to do this using a single aspx page (with the modalpopupextender dynamically loaded there via a placeholder) and my error-handler class raising the event to show the popup back on the page when an error occurs, but have not had success in doing the same using the master.page.