473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Custom controls vs Web parts

Hi,

I'm new in web parts, I would like to understand a couple of things:

Let's say I have a custom control that displays information. That info
is fed to the control through an XML string, so the control parses it
and builds itself.

Now that XML is obtained in the parent page, by calling a c# dll that
deals with the database tier. The page then populates some property in
the control.
Now if I where to convert this control into a web part, how would I go
about getting this information and passing it to the control?

I mean, I don't want any database functionality inside the control,
only to accept some XML string.

How do I get this information to the web part? Is there a concept of
"Page" in Sharepoint?

Please excuse me if this is not the right group, but since asp.net
controls are involved, I figured what the heck :-)

Thanks all!

webo

Jul 13 '06 #1
3 1546
Hi,
You should try to download webpart toolkit from microsoft's site.
That are some templates of webparts I mean, very simple schema of webpart
code ;)
But it is useful. As I had a deal with web parts ( later we have been using
sharepoint as a content server and been connecting from windows forms
client ), You are obliged to write all html code for rendering, so it easier
to paste whole code from Your control to body of method RenderControl ( or
something like that ) what is responsible for rendering webpart on site.
Believe me, this is the first step;) After that, You have to compile signed
webpart and import it to sharepoint site.
The best solution for you is deep analyse of sharepointportal newsgroup:)

Best regards,
Adas

Uzytkownik <we*****@hotmail.comnapisal w wiadomosci
news:11**********************@75g2000cwc.googlegro ups.com...
Hi,

I'm new in web parts, I would like to understand a couple of things:

Let's say I have a custom control that displays information. That info
is fed to the control through an XML string, so the control parses it
and builds itself.

Now that XML is obtained in the parent page, by calling a c# dll that
deals with the database tier. The page then populates some property in
the control.
Now if I where to convert this control into a web part, how would I go
about getting this information and passing it to the control?

I mean, I don't want any database functionality inside the control,
only to accept some XML string.

How do I get this information to the web part? Is there a concept of
"Page" in Sharepoint?

Please excuse me if this is not the right group, but since asp.net
controls are involved, I figured what the heck :-)

Thanks all!

webo

Jul 13 '06 #2

Tomodati wrote:
Hi,
You should try to download webpart toolkit from microsoft's site.
That are some templates of webparts I mean, very simple schema of webpart
code ;)
But it is useful. As I had a deal with web parts ( later we have been using
sharepoint as a content server and been connecting from windows forms
client ), You are obliged to write all html code for rendering, so it easier
to paste whole code from Your control to body of method RenderControl ( or
something like that ) what is responsible for rendering webpart on site.
Believe me, this is the first step;) After that, You have to compile signed
webpart and import it to sharepoint site.
The best solution for you is deep analyse of sharepointportal newsgroup:)

Best regards,
Adas

Uzytkownik <we*****@hotmail.comnapisal w wiadomosci
news:11**********************@75g2000cwc.googlegro ups.com...
Hi,

I'm new in web parts, I would like to understand a couple of things:

Let's say I have a custom control that displays information. That info
is fed to the control through an XML string, so the control parses it
and builds itself.

Now that XML is obtained in the parent page, by calling a c# dll that
deals with the database tier. The page then populates some property in
the control.
Now if I where to convert this control into a web part, how would I go
about getting this information and passing it to the control?

I mean, I don't want any database functionality inside the control,
only to accept some XML string.

How do I get this information to the web part? Is there a concept of
"Page" in Sharepoint?

Please excuse me if this is not the right group, but since asp.net
controls are involved, I figured what the heck :-)

Thanks all!

webo
Thanks Adas for the input, I was actually looking a bit more on the
data-transfer part of it.
Since you have been using web parts, how do they display the
information?
Do they connect directly to the database, or you pass the data to them
from the containing object (call it Page, Parent, etc)

I have an idea how to convert a custom server object into a web part,
but my question is more on the way data will be provided to the web
part itself.

webO

Jul 13 '06 #3
Hi

I don't know if you've found a solution to this yet, but basically, anything
you've handled in a control previously should work in a webpart.
I don't know how you handle your c# dll, but I imagine you should have no
problem using it with a webpart, maybe referencing it in your webpart
project. All data is handled in the same way as in a regular c# project. You
can opt to use the RenderControl method to output html of the webpart to the
page, or use a slightly simpler approach in my opinion, and just use
CreateChildControls method to add labels, textboxes, datagrids and whatnot
which will be automatically rendered and put in the webpart. The data to
output can be put in the labels, textboxes etc in the code and will then be
displayed in the webpart on the page.
Hope this helps at all.

"we*****@hotmail.com" wrote:
>
Tomodati wrote:
Hi,
You should try to download webpart toolkit from microsoft's site.
That are some templates of webparts I mean, very simple schema of webpart
code ;)
But it is useful. As I had a deal with web parts ( later we have been using
sharepoint as a content server and been connecting from windows forms
client ), You are obliged to write all html code for rendering, so it easier
to paste whole code from Your control to body of method RenderControl ( or
something like that ) what is responsible for rendering webpart on site.
Believe me, this is the first step;) After that, You have to compile signed
webpart and import it to sharepoint site.
The best solution for you is deep analyse of sharepointportal newsgroup:)

Best regards,
Adas

Uzytkownik <we*****@hotmail.comnapisal w wiadomosci
news:11**********************@75g2000cwc.googlegro ups.com...
Hi,
>
I'm new in web parts, I would like to understand a couple of things:
>
Let's say I have a custom control that displays information. That info
is fed to the control through an XML string, so the control parses it
and builds itself.
>
Now that XML is obtained in the parent page, by calling a c# dll that
deals with the database tier. The page then populates some property in
the control.
>
>
Now if I where to convert this control into a web part, how would I go
about getting this information and passing it to the control?
>
I mean, I don't want any database functionality inside the control,
only to accept some XML string.
>
How do I get this information to the web part? Is there a concept of
"Page" in Sharepoint?
>
Please excuse me if this is not the right group, but since asp.net
controls are involved, I figured what the heck :-)
>
Thanks all!
>
webo
>

Thanks Adas for the input, I was actually looking a bit more on the
data-transfer part of it.
Since you have been using web parts, how do they display the
information?
Do they connect directly to the database, or you pass the data to them
from the containing object (call it Page, Parent, etc)

I have an idea how to convert a custom server object into a web part,
but my question is more on the way data will be provided to the web
part itself.

webO

Jul 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Crosta | last post by:
Hi everyone, As subject suggests I'm wondering how is it possible to do so in ASP.NET. The fact is that I'd like to "atomize" an entire series of custom user controls (.ascx and .ascx.vb) to...
1
by: Lamont Adams | last post by:
Hi all, I've created numerous custom controls of varying complexity, but I've been on this problem for a day and a half, and I can't figure this mystery out. I hope one of you kind folks can...
3
by: shapper | last post by:
Hello, I am starting to create various custom controls for Asp.Net 2.0 and I am using Visual Studio 2005. I have a few questions: 1. Should I use the Web Site or Project Model? I believe...
2
by: Ron | last post by:
I would like some more information on custom controls, what they can do and things like that, what you would use them for etc... Can anyone here share some examples of what you have used a custom...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.