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 > starter_kits_and_source_projects.dotnetnuke.custom_modules Tags:
Item Type: Date Entered: 8/11/2005 6:26:01 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 58 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
"voodew" <>
NewsGroup User
asp hyperlink parameters and properties and updating on two tables8/11/2005 6:26:01 PM

0

Hello,

 I want to create several links from one view control (lets call it contact.ascx). The view control does not need to list the contents of a given table. The various links direct the user to a particular page to add a new row in the respective table. As the links go to the various edit controls they data bind the page as they click to the edit control. I need an example of how to create one of those links?

 This is what I have tried to implement without success.

 <asp:DataList ID=dlcontact Runat ="server">

            <ItemTemplate>

                        <asp:HyperLink NavigateUrl='<%# "Contact_ID",DataBinder.Eval(Container.DataItem,"Contact_ID") %>' Visible="<%# IsEditable %>" runat="server" ID="HLContact">

                        </asp:HyperLink>

            </ItemTemplate>

</asp:DataList>

 My data base has a parent table called ?Contact? with four child tables (contractor, roofer, source, and client). There are foreign key constraints on the tables. I tried to add a row to one of the child tables independent of the parent table and it didn?t work. I see that I?ll need to add a row to the parent table at the same time as I add a row to one of the children.

 Below is an example of the parent child relationship between Contact and Roofer (I see now that Roofer has a redundant column with ?Name?). So what I am thinking I need to do is have an edit control that has been data bound to both tables. When the user clicks to the edit control in order to add a new contact of entity Roofer they see text field boxes for Name, address, city, etc etc but what they don?t know is that they are entering the name of the contact into the Contact Table and the particulars of that contact in the roofer table. Am I approaching/thinking about this correctly?

 

If I am planning this correctly then the link (Add New Roofer Contact) from the view control needs to data bind to both tables and I figure I will need to write a new stored procedure that updates with a join. 

Contact Table

Roofer Table

 

 

Contact_ID

Roofer_ID

Name

Contact_ID

ModuleID

Name

PortalID

Address

DateAdd

City

DateMod

Province

 

Postal

 

Phone

 

Etc?..

 

 

 

 

 

 

 

 

 

 

 


Thank you in advance,

 Doug

 I organized my components so that everything is included in the info.vb and controller.vb files respectively. I can Dim all the data objects from the same Namespace (I?m not sure if I described that correctly).

 So for example I tried this and it worked.

 Imports System

Imports System.Web

Imports System.Web.UI

Imports System.Web.UI.WebControls

Imports Techsbook.DNN.Modules.Associate.Business

 Namespace Techsbook.DNN.Modules.Associate

     Public MustInherit Class Associate

            Inherits Entities.Modules.PortalModuleBase
            Implements Entities.Modules.IActionable

            Implements Entities.Modules.IPortable

            Implements Entities.Modules.ISearchable

 #Region "Controls"

#End Region

 #Region "Event Handlers"

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            Try

                 'Sample code to get data

                    Dim objctlcontact As New ContactController

  Dim objctlcontractor As New ContractorController

                    Dim objctlroofer As New RooferController

  Dim objctlsource As New SourceController

                    Dim objctlclient As New ClientController

                     If Not Page.IsPostBack Then

                         rptContact.DataSource = objctlcontact.ListContact(ModuleId, PortalId)

                        rptContact.DataBind()

                        rptContractor.DataSource = objctlcontractor.ListContractor(ModuleId, PortalId)

                        rptContractor.DataBind()

                        rptRoofer.DataSource = objctlroofer.ListRoofer(ModuleId, PortalId)

                        rptRoofer.DataBind()

                        rptSource.DataSource = objctlsource.ListSource(ModuleId, PortalId)

                        rptSource.DataBind()

                        rptClient.DataSource = objctlclient.ListClient(ModuleId, PortalId)

                        rptClient.DataBind()

                End If

            Catch exc As Exception

                ProcessModuleLoadException(Me, exc)

            End Try

        End Sub

#End Region

 #Region " Web Form Designer Generated Code "

 

        'This call is required by the Web Form Designer.

        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

 

        End Sub

 

        Protected WithEvents rptClient As System.Web.UI.WebControls.Repeater

        Protected WithEvents rptSource As System.Web.UI.WebControls.Repeater

        Protected WithEvents rptRoofer As System.Web.UI.WebControls.Repeater

        Protected WithEvents rptContractor As System.Web.UI.WebControls.Repeater

        Protected WithEvents rptContact As System.Web.UI.WebControls.Repeater

 

        'NOTE: The following placeholder declaration is required by the Web Form Designer.

        'Do not delete or move it.

        Private designerPlaceholderDeclaration As System.Object

 

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

            'CODEGEN: This method call is required by the Web Form Designer

            'Do not modify it using the code editor.

            InitializeComponent()

        End Sub

 #End Region

     End Class

 End Namespace

 

 


Best regards,

Doug
"matchbx27" <>
NewsGroup User
Re: asp hyperlink parameters and properties and updating on two tables8/12/2005 12:40:23 PM

0

I belive you are need to use EditURL insead of NavigateURL

NavigateUrl='<%# EditURL("ModuleControlKey",DataBinder.Eval(Container.DataItem,"Contact_ID").ToString()) %>'

If you have not already done so goto the Module Definitions (under the Host menu) and edit your module.

Add your Edit Control to the Module Definition (make sure the type is Edit).  The value you use for the "Key Field" is the same value you use for the ModuleControlKey in the EditURL function.

Hope this helps.


matchbx
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:













users online 2.1 up

func download file in filesystemutils (help needed)

advanced datagrid and sql view

listings of custom modules

bug? - urlrewritemodule - input string was not in correct format.

dnn3 and datasets

building a module for dnn 4.0.x using visual studio 2005 and c#

intalling more files with my module

more than what you may think...

problem with bulk user manager

directory module

sql installation script problems

scheduler help - 3.013

dotnetnuke - event registration module?

about esperantus - ml

dnn path masking - url rewriter

datagrid help

weblogs v1.1

image module

isearchable implementation in module

dynamically generated images in a module

puzzling result

contacts module functionality "add contacts"

control for rendering text in an image

dnndownloads 1.2 little problem :(

iactionable problem

accessing portalmodulebase members from a class

crashed dnn

adding option to dropdown list for custom modules

novasoft downloads version 1.4 (free with source)

scrolling items 1.0 dnn

data grid example with drilldown/details?

3.x how to bind itemid to the editurl in moduleactions

callback question

webgrids (aka janus or intersoft) in a user control

how do i change module titles?

rogueproeliator v3 modules (free)

portalsettings

custom module with multiple pages

who wrote the dnntree module?

debugging javascript

check for authentication

liquid platinum weblog issues

events behaving oddly

newsletter application sought

maximized / minimized module container

announcing magichyperredirect: a free module to replace magicredirect

images in private assemblies

announcing module masters mania 2006

downloads broken

   
  Privacy | Contact Us
All Times Are GMT