CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: Date Entered: 2/7/2008 7:27:49 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 10 Views: 84 Favorited: 0 Favorite
11 Items, 1 Pages 1 |< << Go >> >|
"asp_netvb" <>
NewsGroup User
Connecting Web Parts2/7/2008 7:27:49 PM

1

Hello,

I'm recieving the following error message below. Basically I have 2 WebParts. The first WebPart has a dropdown that display items when you select an item from the dropdown then It should populate the details within WebPart 2 inside of a GridView. Please see my .ASPX page below to make sure I'm not missing something. Thanks in advance!!

 

There is no provider connection point 'default' on 'First Web Part'.
 
 
<asp:WebPartManager ID="WebPartManager1" runat="server" Personalization-InitialScope="Shared">

<StaticConnections>

<asp:WebPartConnection ID="WebPartConnection" ProviderID="grid9" ConsumerID="Ipdb1">

</asp:WebPartConnection>

</StaticConnections>

</asp:WebPartManager>

<asp:DropDownList ID="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True">

<asp:ListItem Enabled="true" Value="Browse"></asp:ListItem>

<asp:ListItem Enabled="true" Value="Edit"></asp:ListItem>

<asp:ListItem Enabled="true" Value="Catalog"></asp:ListItem>

</asp:DropDownList>

 

<br />

 

<asp:LinkButton ID="LinkButton1" OnClick="LinkButton1_Click" runat="server">Reset</asp:LinkButton>

 

<br />

<%--First WebZone--%>

<asp:WebPartZone ID="WebPartZone1" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana" Padding="6">

<EmptyZoneTextStyle Font-Size="0.8em" />

<PartStyle Font-Size="0.8em" ForeColor="#333333" />

<TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />

<MenuLabelHoverStyle ForeColor="#E2DED6" />

<MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.6em" />

<MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />

<PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />

 

<%
--First WebPart--%>

<ZoneTemplate>

<subnets:ipdb id="grid9" runat="server" title="First Web Part" width="500" />

</ZoneTemplate>

<%--End First WebPart--%>

 

<MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />

<PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />

<HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />

<MenuLabelStyle ForeColor="White" />

</asp:WebPartZone> <%--End First WebZone--%>

 

<br />

<br />

 

<%
--Second WebZone--%>

<asp:WebPartZone ID="WebPartZone2" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana" Padding="6">

<EmptyZoneTextStyle Font-Size="0.8em" />

<PartStyle Font-Size="0.8em" ForeColor="#333333" />

<TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />

<MenuLabelHoverStyle ForeColor="#E2DED6" />

<MenuPopupStyle BackColor="#5D7B9D" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.6em" />

<MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />

<PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />

 

<%
--Second WebPart--%>

<ZoneTemplate>

<ip:ipdb id="Ipdb1" runat="server" title="Second Web Part" width="500" />

</ZoneTemplate>

<%--End Second WebPart--%>

 

<MenuVerbHoverStyle BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />

<PartChromeStyle BackColor="#F7F6F3" BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="White" />

<HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />

<MenuLabelStyle ForeColor="White" />

</asp:WebPartZone>

<%--End Second WebZone--%>

"littlefool" <>
NewsGroup User
Re: Connecting Web Parts2/9/2008 8:31:31 PM

0

The provider (webpart with dropdownlist) need to have a method that has the ConnectionProvider-attribute and returns an interface with the data.
The consumer (webpart with gridview) need to have an entry-point by specifying a method with the ConnectionConsumer-attribute. Both attributes needs to have the same name in their parameters.
This allows the WebPartManager to know to send what data from where to where. Without these methods, your WebParts won't be recognized as "connectable" parts ;)

I hope this article will give you an overview of WebPart connections: http://msdn.microsoft.com/msdnmag/issues/06/02/BasicInstincts/

The aspx code seems ok


"Dream as if you'll live forever, live as if you'll die today" (James Dean)
"asp_netvb" <>
NewsGroup User
Re: Connecting Web Parts2/11/2008 9:02:56 PM

0

Please let me know if my Provider and Consumber connections look okay.

<%@ Implements Interface="IField" %>

<script runat="server">

Public ReadOnly Property Message() As Integer _
Implements IField.Message

Get

Return _subnetsList.SelectedValue

End Get

End Property

<ConnectionProvider("Message")> _

Public Function GetMessage() As IField

Return Me

End Function

</script>

 

<script runat="server">

Private _message As IField

 

<ConnectionConsumer(
"Message")> _

Sub SetMessage(ByVal message As IField)

Me._message = message

End Sub

 

</script>

"littlefool" <>
NewsGroup User
Re: Connecting Web Parts2/12/2008 7:36:01 AM

0

Yes, this seems to be ok. and implementing it quickly in a demo it works for me as well ;)


"Dream as if you'll live forever, live as if you'll die today" (James Dean)
"asp_netvb" <>
NewsGroup User
Re: Connecting Web Parts2/12/2008 1:05:54 PM

0

See it works for me with one WebPart but does not populate the other WebPart :(

I created a usercontrol to populate data to a dropdownlist control within WebPart one. I would like to pass the value which is an integer from the dropdown to the second WebPart which is a GridView Control. I can't figure this out for the life of me. Any help would be greatly appreciated

Thanks in advance!!

"littlefool" <>
NewsGroup User
Re: Connecting Web Parts2/12/2008 1:32:43 PM

0

You are missing probably the OnPreRender method where you actually performs the binding of your gridview with the received data.

The binding has to be done "OnPreRender" because earlier in the page lifecycle you are never sure if already received the data or not. 
Try adding next method in your consumer web part

    Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
        ReceivedData As Integer = Me._message.Message
        ' bind the gridview
MyBase.OnPreRender(e)
End Sub

 sorry if the syntax is wrong. I don't know much VB :S


"Dream as if you'll live forever, live as if you'll die today" (James Dean)
"littlefool" <>
NewsGroup User
Re: Connecting Web Parts2/12/2008 1:33:43 PM

0

You also need to have PostBack = True on your DropDownList so that a postback is performed when you change the dropdownlist.


"Dream as if you'll live forever, live as if you'll die today" (James Dean)
"asp_netvb" <>
NewsGroup User
Re: Connecting Web Parts2/13/2008 3:46:38 PM

0

Still having trouble populating the data from the dropdownlist. Please see my interface code below to make sure I have it setup correctly. Also, what should I have to "RecievedData" it tells me that it's not defined.

<%@ Implements Interface="IField" %>
<script runat="server">
Public ReadOnly Property Message() As Integer _
Implements IField.Message
Get
Return subnetsList.SelectedValue
End Get
End Property
<ConnectionProvider("Message")> _
Public Function GetMessage() As IField
Return Me
End Function
</
script>

<script runat="server">
Private _message As IField
<ConnectionConsumer(
"Message")> _
Sub SetMessage(ByVal message As IField)
Me._message = message
End Sub
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
If (Not (_message) Is Nothing) Then
ipList.SelectedIndex = _message.Message
End If
MyBase.OnPreRender(e)
End Sub
</
script>

"littlefool" <>
NewsGroup User
Re: Connecting Web Parts2/13/2008 6:31:31 PM

0

SelectedValue is a string, so when probably should cast it to an integer first in the property. unless you have your Message declared as string in your interface. then you will have to cast it to an integer when you bind it to the SelectedIndex.


"Dream as if you'll live forever, live as if you'll die today" (James Dean)
"asp_netvb" <>
NewsGroup User
Re: Connecting Web Parts2/13/2008 9:42:51 PM

0

Still no dice. The value that I'm trying to retrieve is an "integer". I applied the code that you provided and I do not recieve any errors except that it does not retrieve the data into the second webpart. Can you give me an idea as to how i should cast it as an integer and where. Sorry still learning. Thanks a million for all of your help.

 

"asp_netvb" <>
NewsGroup User
Re: Connecting Web Parts2/15/2008 3:25:58 PM

0

I need help with the interface connection.

Please Help!! Very desperate.

11 Items, 1 Pages 1 |< << Go >> >|


Free Download:













are webparts equivalent to portlets of java??????????

profile providers/findprofilesbyusername method

create a webpart in multiple languages

fileupload webcontrol and portal webparts

event handlers in editor part don't fire

an error has occurred while establishing a connection to the server

ipersonalizable? [personalizabe(true)]?

using one users personalization for a group of users

multi postbacks

question about web parts

how can i??? membershipprovider asp .net 2.0...

can web parts developed in vs2005 deployed as individual dll files? how?

problem with dynamic webpartzone

adding submenus?

using different profile providers

autosizing of a webpart when another is added issue

adding webpart to webpartzone programaticly...

webparts - can't see minimize or close links

how to know if a page is in edit mode?

page refresh while loading webparts

dynamic web parts - ids constantly changing

handle the close of catalogzone (pagecatalogpart)

page flakes elegant web part drag and drop

change web part title bar color

personalising a datalist depending on user logged in

add webpart from another page

web parts: verb menu is not showing

looping profiles for all users???

profile panda

highlight or underline hyperlinks or buttons on mouse over

building a (very basic) wysiwyg editor with webparts

how do i use authorization filter

seen this: 'protected readonly property profile() as system.web.profile.defaultprofile'

creating new membership/role account

portalframework does not use virtual (mapped) url's

how to dynamically add controls to a web part

webparts - parttitlestyle

unable to start personalization services

firefox compatability

changing font sizes globally

binding connectionprovider to connectionconsumer

using sharepoint web parts

webpartmanager configuration

personalized properties within a usercontrol within a webpart

help required regarding sphttpapplication

format appearance of webparts

error deploying website with webparts

anonymous personalization

please send me simple web part projects.

about webparts ,personalization

   
  Privacy | Contact Us
All Times Are GMT