0

I need to pass SPWeb an SPList as function parameters:

string check(SPWeb web1, SPList splist1){}

Yet, web1.Title, splist1.Title throws errors:

There is no Web named "/http://DevSite".

Is there another way to get this variables? by passing as a reference?

  • 1
    how are you creating SPWeb object? Its seems problem with the way you are initializing these objects. – Amal Hashim May 27 '15 at 15:06
  • yes ! you are right! The error was at the calling function !! – XristosK May 27 '15 at 15:21
0

The error was in the calling function. Before:

using (SPWeb web11 = spsite.OpenWeb(webURL))
    {
      if (web11 != null)
         {
            spweb = web11; <-- error
            splist = spweb.GetList(paramwebURL);
          }
     }
return check(spweb,sptitle);

The correct is : spweb = spsite.OpenWeb(webURL); For (unknown to me) reason, assignment between SPWeb's didn't worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.