.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

NewWebPage Method in Client Object Method

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

I'm trying to create a new web part page using cleint om in SP 2010. is this possible? on SPWeb posting this used to work


<Method ID="Text">
 <SetList Scope="Request">GUID</SetList>
 <SetVar Name="Cmd">NewWebPage</SetVar>
 <SetVar Name="ID">New</SetVar>
 <SetVar Name="Type">[WebPartPage|BasicPage]</SetVar>
 <SetVar Name="WebPartPageTemplate">[1-8]</SetVar>
 <SetVar Name="Overwrite">[true|false]</SetVar>
 <SetVar Name="Title">Text</SetVar>

 I can do a file upload as well but does not see that clean...



View Complete Post

More Related Resource Links

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Object does not support this property or method....

This is a pretty straightforward piece of code. Why am I getting this error on line 5 char1?<script type="text/javascript"> function resubmit() { var recip = document.getElementById("web_recip"); var ind=recip.indexof("?resubmit"); if (ind>0){ recip=recip.replace("?resubmit",""); var resub=document.getElementById("resub"); resub.value="Y"; } } </script>  

How to call CodeBehind Method from Client Side

Hi forumers,How can we call a CodeBehind Method with Arguement from Client Side?Here is the idea: this wont work<script type='text/javascript"> function func(){ var str = 'Hello World'; var result = '<% =CodeBehindFunction( str ) %>' } </script>I have a variable "str" and has a value of "Hello World".. I want to pass the value of "str" to the CodeBehind Method which is "CodeBehindFunction(object obj)"..How can I accomplish this idea without the use of XMLhttprequest, is it possible?

Calling a method with a class object as parameter data type.

   [WebMethod]    public string GetInfo(Customer inCust)    {        // Code in here    } I have a web service that resides on a remote server. I want to call a public method of theweb service named  "GetInfo". The method is shown above. The web service method expects a class object oftype "Customer". What I did to create a Customer object was to define in my asp.net project my own class named "Customer" which is exactlythe same as the class that belongs to the web service project on the remote server. I then created an instance of Customerand tried to call the web service passing in an object of type customer : my.Service ws = new my.Service(); // Get web service connectionCustomer aCustomer = new Customer();aCustomer.Initialize();ws.GetInfo(aCustomer) // call web service passing in a Customer object The problem is that the compiler gives me the following error: Value of type '_Default.Customer' cannot be converted to 'ws.Class1'. Here Default is refering to my Default.aspx.cs code. Why is this? Do I need to Cast my "aCustomer" class object to a type ofws.Customer ? How do I do that?

Why request parameter added to client side code in each method while using svcutil.exe

Hi, I am using WCF services in my project and want to call WCF methods asynchronously. I am hosting WCF service programmatically in windows app as follows svc = New ServiceHost(GetType(Service1), New Uri("net.tcp://localhost:8806/")) Dim svcMDB As New ServiceMetadataBehavior svc.Description.Behaviors.Add(svcMDB) svc.AddServiceEndpoint(GetType(Service1), New NetTcpBinding(), "MyBusiness/MyBusinessService/") svc.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBinding(), "MyBusiness/MyBusinessService/mex") svc.Open() Me.Text = "Service started...." and I am generating client side proxy using svcutil.exe as follows. svcutil /n:net.tcp://localhost:8806/MyBusiness/MyBusinessService,MyService net.tcp://localhost:8806/MyBusiness/MyBusinessService/mex /a /language:vb   The result of this command is as :   Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved.   Attempting to download metadata from 'net.tcp://localhost:8806/MyBusiness/MyBusi nessService/mex' using WS-Metadata Exchange. This URL does not support DISCO. Generating files... D:\Prabodh\New C2k\Test Projects\DataTableToArray\MyHost\bin\Debug\MyBusinessSer vice.vb D:

Provide object over network on callback method

Hello. I am building a client server video monitoring system. I will have a user (viewer) connect to a web page on a server, pick a camera and see what is going on at the particular location. A general WCF question: How can I access VideoSource custom class object remotely on the server via WCF? Basically, I have a VideoSource and VideoSourcePlayer that work great, when are within one process, but how can I access VideoSource object remotely? An example link would be enough. Thank you.  Max Pavlov http://maxpavlov.com

passing messageContract object to a WCF Service method using Soap - not as a method parameter

i want a web application to create a service reference to my WCF service, insert information to the header of the soap call and call my WCF method. my WCF supports soap operations (also there is an endpoint in the config). i read about MessageContract attribute and declared one in the interface file: [ServiceContract] public interface IBasicService { [OperationContract] [WebGet(UriTemplate = "GetData?value={value}")] // Add support for HTTP GET Requests string GetData(int value); } [MessageContract] public class BasicServiceHeader { [MessageHeader] public string myString; } the implementation of the contract : public class BasicService : IBasicService { public string GetData(int value) { return string.Format("You entered: {0}", value); } } i don't want the BasicServiceHeader to be passed as a parameter of GetData function , i want to keep the function signature as it is (without a BasicServiceHeader parameter) and to extract the BasicServiceHeader inside the function, (just like using soapHeader) can i do that ?

Help!!! How to call javascript method in client template???


<script id="menuTemplate" type="text/html">
        <option value="${MenuId}" level="${Level}">
 ${Name} //call some js method here? </option> </script>

How to call javascript method in client template (http://github.com/jquery/jquery-tmpl)

An object reference is required for the nonstatic field, method, or property 'object.GetType()'


I'm getting this error, what i'm missing?

error: An object reference is required for the nonstatic field, method, or property 'object.GetType()'


static public void RegisterScriptMethod(System.Web.UI.Page page, string methodName, string methodBody)


StringBuilder sb = new StringBuilder();


"<script language='javascript'>");


"function " + methodName + " {" + methodBody + "}");



//page.RegisterClientScriptBlock(methodName, sb.ToString());

LDAP Authentication against SunOne using getdirectoryentry method of directorysearcher object in Asp

Hi All,
I am authenticating user in following way but it says "unknown username or password" even though I provide correct username and password. I am authenticating against Sunone directory server. Unfortunately as per rquirement I could not bind any user with the direcory except service username and password.

I could not figure out whether this correct way or not. Any help would be appreciated.

DirectoryEntry entry = new DirectoryEntry("LDAP URL");

entry.AuthenticationType = AuthenticationTypes.ServerBind;
entry.Username = "uid=thost,ou=somthing,dc=something,dc=something";
entry.Password = password;
DirectorySearcher search = new DirectorySearcher(entry);

search.Filter = "(uid=" + actualUid + ")";
SearchResult rc = search.FindOne();


DirectoryEntry de = rc.GetDirectoryEntry();
de.Password = actualPassword;
object o = de.NativeObject;

catch (Exception ex)

Method 'Post' of object 'IOWSPostData' failed


I have Microsoft Office 2003 and Microsoft Sharepoint Designer 2007 on the
same machine. I have a problem uploading an excel spreadsheet into WSS 3.0.
I get Method 'Post' of object 'IOWSPostData' failed error. I have followed
this article (http://mindsharpblogs.com/Kathy/archive/2008/03/16/4450.aspx)
but it doesn't resolve the issue.
Pls, advise how can I resolve this.

Thank you in advance!


How to user LoadControl(Type type, object[] para) method?



protected void Page_Load(object sender, EventArgs e)
            // This is NOT working. I dont see user control on page
            Type type = Type.GetType("TestProject.UserControls.Gender");                
            Control uc = Page.LoadControl(type,null);            

            //This is working. I can see user control on page
            Control uc1 =  Page.LoadControl("~/UserControls/Gender.ascx");            

 Im trying to load User Control dynamically using LoadControl(Type type, object[] para) method but its not working. I do not get any exception but i dont see user control render on the page. I have a Default parameterless construction in my user control and i see its get executed when i put break point there. but i dont see user control rendered on my page.

If i use OverLoaded method LoadControl(string VirtualPath) then it works fine.


TCP Client/Server communication: NetworkStream.Write() send partial data unless close() method is re

Hi to all,
I wrote a simple client-server application that comunicate through NetworkStream class. The problems comes when stream.close() and client.close() methods are called. It look like only the first 10415 bytes are sent once those methods are called. So, if the data to send is more than this size, it is automatically truncated.

If I  remove both stream/client close() methods from the code, the data is fully received whatever the size is. I tried various alternative solutions (the ones marked as comments in the sample code), but none of them works.
The only thing that seems to work is adding a manual delay before the close() methods execute with something like that:

For Counter as integer = 0 to 10

The problem is that after delay I still don't know if all the data has been transfered or not. In addition to that, I will have to wait 10 seconds before sending another request, even if the response is just a few bytes of data. I could change at runtime the number of seconds to wait according to the size of the data to send, but I still think that delay is not a solution and will cause adverse effects.

So, for now the only working solution is to remove both Stream/Client Close() methods from

Abort() method of wcf client proxy doesn't release session after catching FaultException



I have created a simple wcf service hosted in IIS and wcf client and figured out that when u catch a FaultException from the wcf service and then call client.Abort() to release the session (as the microsoft samples said) it doesn't release the session and hangs up on the 11th call.

Here is example:

Wcf Service:

public interface IService1 
    string GetData(int value); 
public class Service1 : <

Abort() method of wcf client proxy doesn't release session after catching FaultException



I have created a simple wcf service hosted in IIS and wcf client and figured out that when u catch a FaultException from the wcf service and then call client.Abort() to release the session (as the microsoft samples said) it doesn't release the session and hangs up on the 11th call.

Here is example:

Wcf Service:

public interface IService1 
    string GetData(int value); 
public class Service1 : <

CreateDocument method in CMIS Object Service raising the Constraint Violation Exception


HI All,

Below are the code snippet for rasing the above exception like  "The operation violates a Repository- or Object-level constraint defined in the CMIS domain model. "


ObjectServicePortClient objectService = new TestCMISWinApp.ObjectService.ObjectServicePortClient("BasicHttpBinding_IObjectServicePort");

objectService.ClientCredentials.Windows.AllowNtlm =



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