Use Controls In Sharepoint Without Using The Spcontext.current?

Feb 10, 2010

Sharepoint Controls require SPContext.current.site/web to work, but i am opening many sites using site= new spsite(siteID); and i want to use Controls. available class to use asp.net controls in sharepoint?

View 2 Replies


Similar Messages:

Web Forms :: Current Logged In User's Information In Sharepoint List?

Oct 8, 2010

in order to prepopulate some user information, i used query to search the sharepoint list. my question is how to search loggin user's info in the list. i used following testing query function. it works fine. however, it can only search specific text, cannot be changed according different user.

[Code]....

View 1 Replies

Unable To Call The SharePoint Custom Web Service From Another SharePoint Farm

Jan 12, 2011

I have deployed a custom SharePoint Web service on Farm A. I am trying to access this Web service from a SharePoint timer job on Farm B. On Farm B, I am creating Class Library project, packaging it (wsp) and then deploying to GAC. The problem is I'm unable to access the Web Service using the following code. TodaysNewSVC is a service reference

TodaysNewSVC.GetTodaysnewsfromInsite objGetNews = new TodaysNewSVC.GetTodaysnewsfromInsite();
objGetNews.PreAuthenticate = true;
objGetNews.Credentials = CredentialCache.DefaultCredentials;
objGetNews.Url = "http://insite-dev.portal/_vti_bin/todaysnews.asmx";
DataTable dt2 = objGetNews.getNewsFromInsite(true, true);

//getNewsFromInsite is a WebMethod which returns the DataTable.

Note: Both farms use the same active directory authentication. I have also done the debugging for Timer Job and feature activation and they are working fine. The problem occurs during the call i.e. getNewsFromInsite
The asmx and wsdl files are accessible from Internet Explorer and also from Windows Console application. Here is the code which I use from console application:

GetTodaysnewsfromInsiteSoapClient objWSClient = new GetTodaysnewsfromInsiteSoapClient();
objWSClient.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;[code]...

Here is the error message:The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="%2fPages%2fproblem-with-page.aspx%3fc%3d500">here</a>.</h2>
</body></html>

View 1 Replies

Error: "Could Not Load Type 'Microsoft.SharePoint.WebControls.SPGridView" SharePoint 2010

Jun 15, 2010

Following error comes when creating a WebPart In sharePoint 2010 Server.

Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeLoadException: Could not load type 'Microsoft.SharePoint.WebControls.SPGridView' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. at ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)

View 1 Replies

RenderAction Not Finding Action Method In Current Controller In Current Area?

Mar 15, 2010

I'm creating an ASP.NET MVC 2 (RTM) project that uses areas. The Index action of the Home controller of one area needs to use RenderAction to generate a sub-section of the page. The action called is also defined in the same Home controller. So the call should just be:

<% Html.RenderAction("List") %>

However, I get an exception:A public action method 'List' was not found on controller 'RareBridge.Web.Areas.Events.Controllers.HomeController'.

Note that I'm not in the "Events" area! I'm in a completely different area. If I remove the "Events" home controller, then the exception still occurs but names a different controller (still not the one I want it to call).

I've also tried providing the controller name and area to the RenderAction method, but the same exception occurs. What is going on here?

BTW: I am using Autofac as my IoC container

View 2 Replies

Web Forms :: Find Current URL Of Page During Code Behind Submission (NOT Current Web App URL)

Aug 18, 2010

I am looking for a way to figure out the current URL that the page is currently on (NOT what the asp.net page currently is, but where the CODE is at). ie. My web app is located at: [URL] my code is: String page = [URL]

String response = GetResponse(page); //basically the above code goes to the website [URL] and parses the HTML within it and brings it back and populates the variable string "response". But, sometimes the [URL] throws me a curve ball and redirects me to: [URL] I want to be able to use a try/catch to be able to "catch" the error of a different page: ie validateUser.aspx. So, I need to do to this: try

{
String page = [URL];
String response = GetResponse(page);
}
catch
{
//code to check the behind URL to see if [URL] is the URL OR IF [URL] is the current URL
}

understand I know how to find the URL of the current page the web app is on. I need to find the current page that threw the exception during the execution of the code behind.

View 1 Replies

DataSource Controls :: Import Exel File In Sharepoint Into MS SQL?

Feb 10, 2010

There is an Excel document that is being updated and stored in a Sharepoint list. I am using the Import wizard in MS SQL to import the Excel data. Since the file is in a list in Sharepoint can I get access to it? I can see the file in Explorer in a web folder, but this file will not import. I have been able to import the file from my hard drive. What is the best solution for this? Should I import the Excel into Sharepoint? How can I get the data stored in the Excel file in Sharepoint into MS SQL?

View 1 Replies

DataSource Controls :: Emove Reference To Old Sharepoint Server?

Jan 29, 2010

I'm trying to remove Sharepoint in its entirety from my server (2003). I've uninstalled Sharepoint, but in SQL Server Management Studio, I still have a reference to the OfficeServers database, in the dropdown, though I can't find it anywhere in the SQL Server folder hierarchy

View 1 Replies

Access The Current Thread's Context Using HttpContext.Current?

Mar 11, 2010

I have a static class with serveral static methods. In these methods, I'm trying to access the current thread's context using HttpContext.Current. For example:

var userName = HttpContext.Current.User.Identity.Name;

However, when I do that, I receive a NullReferenceException, the infamous "Object reference not set to an instance of an object."

View 3 Replies

How To Create Webparts Controls For Sharepoint 2007 In Delphi Prism

Jun 16, 2010

can i create webparts controls for Sharepoint 2007 in Delphi Prism? If yes, how?

View 1 Replies

Forms Data Controls :: Details View Update In A Sharepoint Web Part

Jul 29, 2010

I have a web part that is deployed in a MOSS 2007 application. The web part has a text box for entry of an ID number and a button that fills a dataset from the db based on the supplied ID and binds this to a details view. The details view is a private variable declared at the top of my web part class, the details view is then instantiated and various properties set along with the event handlers in the CreateChildControls() Sub.

[Code]....

The details view is then rendered in the RenderContents() sub.

[Code]....

After checking the user inputted ID number for malicious chars I fill a data set.

[Code]....

The problem is that when I click the auto generated Edit link nothing happens and if I then click it for a second time the editable text boxes appear but have no data in them and my data key appears to have been overwritten. I have also tried entering new values into the text boxes and clicking the Insert link and then looping through the NewValues collection inside the ItemUpdating event but this displays nothing!

View 3 Replies

DataSource Controls :: Error Accessing SQL Server Db From User Control In SharePoint

Jan 15, 2010

I'm developing an ASP.NET user control in VS2008 that writes to a SQL Server 2005 database. I've published the control to a SharePoint 2007 MOSS page using the SmartPart addon. The control consists of a few text fields and a submit button that writes the contents of the text fields to the database. When I test the control in the Visual Studio debugger, it works fine. When I try to submit data from the SharePoint page, I get the error shown at the end of this post. Last time I saw this, it was a database permissions error, but I've granted my site's default application pool read/write access to my database. Does anyone have any idea what else the problem might be? Also, how can I double-check the credentials that the SharePoint page is using to access the database, since I still suspect that this is a permissions issue?

[ERROR TEXT FOLLOWS]
Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
ConnectionHandler.ClientDataConnect() +103
ClientData.ClientData.Page_Load(Object sender, EventArgs e) +1426
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +41
System.Web.UI.Control.OnLoad(EventArgs e) +131
System.Web.UI.Control.LoadRecursive() +65
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

View 2 Replies

Web Forms :: Get Name Of Current Page And Current Subroutine

Oct 17, 2010

I am building in error-logging into my site, and want to be able to get hold of the current page name that the error occurred in, as well as the specific subroutine or function, to then pass to a VB.NET function. Is there anyway to get hold of this information without hard-coding the names manually? For example,

Dim strCurrentPageName = ???
Dim strCurrentRoutine = ???

View 6 Replies

Custom Server Controls :: Registering Controls Of Current Assembly Object Reference Not Set Error

Aug 21, 2010

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).I don't want to register my control using Src, TagPrefix etc.

View 4 Replies

DataSource Controls :: How To Know Current Active Sheet Name In C#

May 12, 2010

i am creating a web based application in which user can upload excel file. my code is :

string ExcelConString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileName + ";Extended Properties=Excel 8.0";
OleDbConnection oledbConn = new OleDbConnection(ExcelConString);
OleDbDataAdapter oda = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", oledbConn);
DataSet ds = new DataSet();
oda.Fill(ds);

it works fine, but when user rename the sheet1 than run time error occured plz help me how to know active sheet NAME through c#/vb.net OR how to know first sheet NAME.

View 1 Replies

DataSource Controls :: Create CSV Using Current Filtering

Feb 24, 2010

I currently have a common file that's responsible for exporting the users GridView to a CSV file which works fine, mostly. The problem is that it only exports the current gridview display, and being that I have it paged, it can be cumbersome to get all the data to an excel sheet when there can be upwards of 20 pages of data. The GridView has a LINQ datasource as follows

[Code]....

How do I get the results of the preceeding datasource? Or is there a better way to get ahold of that data before it is paged?

View 1 Replies

AJAX :: Unable To Get The Current Aspx Controls?

Dec 19, 2010

I cannot see or access any of current aspx controls like TextBox or ComboBox ..., WHY ?

[Code]....

View 1 Replies

DataSource Controls :: Current Day On Select Statment?

Jun 24, 2010

looking for solution to fix the code every day i change by manual how can fix to current day.SelectCommand="SELECT * FROM articles WHERE (date > '23 / 06 / 2009') ORDER BY date"how can change the to current time direct

View 5 Replies

SQL Server :: Query Which Should Get Current Date And Compare current Date With Date In Table?

Nov 19, 2010

How to create Jobs, I am using SQL 2005, i need a query which should get current date and compare current date with date in table and Send Email according to Job scheduled.

View 4 Replies

DataSource Controls :: How To Select Current Week Records

Jan 27, 2010

I want to select the records of current week, Starting day should be from saturday till Friday.

I can fetch the records of current week:

[Code]....

but starting day of week is Sunday and ending is Saturday.

What I want is, Starting day should start from Saturday and ending day should be Friday.

View 11 Replies

DataSource Controls :: How To Pull Only The Current Month Data From SQL

Jan 20, 2010

How would you pull only the current month data from SQL?

View 9 Replies

Forms Data Controls :: How To Get The Current Datakeyname For Row When The Linkbutton Is Hit

Jan 26, 2010

I have a linkbutton in a gridview. Now what i did before is have a select on the gridview and when that was clicked it activated the indexchanged event and i was able to get the current datakeyname. Is there a way to get the current datakeyname for that row when the linkbutton is hit.

View 4 Replies

Forms Data Controls :: Adding Row Above Or Below The Current Gridview Row

Mar 8, 2010

In gridview when i click on the particular row, when i click on 'Insert' link button in grid view row javascript menu will come that i can do lnkbutton .attribute.add("onclick","window.openI("link") after selecting the input from the popup, row should be inserted above the current row or below the current row. depending on the selection , how i can do this with datatable

1)getting the user input

2)Adding row above or below the current grid view row depending on selection in popup

View 1 Replies

Forms Data Controls :: How To Get Info Of Current Row In A Gridview

Jan 10, 2010

I have a gridview on which there is a colume of image button for user to select a particular row. When a row is selected, a modal pop up appears for user to edit data and finally uers hit update button (within modal pop up). I expect to update the selected gridview row with info on modal pop up. My question is how do I get the row number within the Update_Click event.

View 2 Replies

DataSource Controls :: How To Get The Current Identity Number When Doing Insert

May 20, 2010

The scenario is that I wanna insert a record to the database via INSERT query and I need to user the identity number of this record in the INSERT query.

But I don't know how to achieve this.

Here is my table structure and code for your better understanding.

There are three columns in the Table: categoryID, categoryName, categoryPath. I need the path based on the categoryID which is an identity int column.

Now I used this code to do INSERT:

[Code]....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved