Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Web Part Blues

  Asked By: Kara    Date: May 16    Category: Sharepoint    Views: 696

I am developing a webpart.

The webpart has to display data in a Datagrid. This is where the
problem arises.

In the CreateChildControls() method, if i mention a Datasource for the
DataGrid, the Webpart is throwing a WebPart Maintenance Error. If i
just remove this line from code(datagrid1.datasource = xyz) , then
error is not being thrown.

I tried debugging thru Visual Studio. After removing the above said
line of code, I inser breakpoints at various points.

The fun part is that the breakpoints in constructor of the WebPart are
not getting visted (i.e constructor not getting called)

Also in the RenderWebPart method all the lines of code are not getting



6 Answers Found

Answer #1    Answered By: Jarret Riddle     Answered On: May 16

Have you followed all the guidelines for Code Access Security? Chances are you
are having trust issues with making connections to the data  source.

Answer #2    Answered By: Viren Rajput     Answered On: May 16

I a working on WSS Application, i am using web  part
and user controls too. But i don't know about web part
b'coz of i am new to this.

Please tell me what is web part  and how to create and
give some links to read.

Answer #3    Answered By: Gabrielle Welch     Answered On: May 16

I found these url's very useful when I started web  part development:

// web part  tutorial

msdn.microsoft.com/.../odc_sp2003_" target="_blank" rel="nofollow">msdn.microsoft.com/.../odc_sp2003_

// web parts that uses web services

msdn.microsoft.com/.../odc_sp2003_" target="_blank" rel="nofollow">msdn.microsoft.com/.../odc_sp2003_

// connected webparts


// step by step tutorial for developing  web part


// makeing web parts interact


I will also recommend SMARTPARTS.. As it cuts down development time:



// smart parts series




Answer #4    Answered By: Janessa Riggs     Answered On: May 16

U can get a sample web  part in WSS SDK, it got simple web part  to a
linked web part.

Answer #5    Answered By: Nisha Gadre     Answered On: May 16

I've used an alternative approach to rendering a datagrid, which is to create a
datagrid instance, bind it to the source, and use the datagrid's rendercontrol
method to write it's HTML to the output stream. You might try this approach,
since it doesn't require a call to CreateChildControls(). The code  looks
something like this

Dim dg As New DataGrid

dg.DataSource = ds



Answer #6    Answered By: Chirag Gupte     Answered On: May 16

Create an ASCX page and do all the datagrid  stuff in that and load that
ascx in web  part and render, it is very easy.

Didn't find what you were looking for? Find more on Web Part Blues Or get search suggestion and latest updates.