Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Viewstate Help!
Previous Previous
 
Next Next
New Post 6/16/2008 10:10 AM
Unresolved
User is offline Sam
3 posts
10th Ranked


v13wstat3 Help! 

Please help,

I've followed the instructions for creating a dotnetnuke compiled module, i've added 2 controls to the datalist itemtemplate a button and a textbox.

In design mode i 've changed the text in the text box to 'abc'.

When i compile dnn and import the control it looks fine, but the v13wstat3 isn't being maintained,

if i change the text and press the button the text goes back to what is was in design mode. its as if the module is constantly being reset to defaults on every post.

Please tell me what i'm doing wrong.

Option Strict Off
'
' DotNetNuke® - http://www.dotnetnuke.com
' Copyright (c) 2002-2005
' by Perpetual Motion Interactive Systems Inc. ( http://www.perpetualmotion.ca )
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection

Imports DotNetNuke
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization

Namespace YourCompany.Modules.TBSMS

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' The ViewTBSMS class displays the content
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Partial Class ViewTBSMS
        Inherits Entities.Modules.PortalModuleBase
        Implements Entities.Modules.IActionable

#Region "Event Handlers"

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' Page_Load runs when the control is loaded
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load
            Try
                Dim objTBSMSs As New TBSMSController
                Dim colTBSMSs As List(Of TBSMSInfo)

                ' get the content from the TBSMS table
                colTBSMSs = objTBSMSs.GetTBSMSs(ModuleId)

                If colTBSMSs.Count = 0 Then
                    ' add the content to the TBSMS table
                    Dim objTBSMS As TBSMSInfo = New TBSMSInfo
                    objTBSMS.ModuleId = ModuleId
                    objTBSMS.Content = Localization.GetString("DefaultContent", LocalResourceFile)
                    objTBSMS.CreatedByUser = Me.UserId
                    objTBSMSs.AddTBSMS(objTBSMS)
                    ' get the content from the TBSMS table
                    colTBSMSs = objTBSMSs.GetTBSMSs(ModuleId)
                End If

                ' bind the content to the repeater
                lstContent.DataSource = colTBSMSs
                lstContent.DataBind()

            Catch exc As Exception        'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

        Protected Sub lstContent_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles lstContent.ItemDataBound
            Dim strContent As String = ""

            ' add content to template
            If CType(Settings("template"), String) <> "" Then
                strContent = CType(Settings("template"), String)
                Dim objProperties As ArrayList = Common.Utilities.CBO.GetPropertyInfo(GetType(TBSMSInfo))
                Dim intProperty As Integer
                Dim objPropertyInfo As PropertyInfo
                For intProperty = 0 To objProperties.Count - 1
                    objPropertyInfo = CType(objProperties(intProperty), PropertyInfo)
                    strContent = strContent.Replace("[" & objPropertyInfo.Name.ToUpper & "]", DataBinder.Eval(e.Item.DataItem, objPropertyInfo.Name).ToString())
                Next intProperty
            Else
                strContent = DataBinder.Eval(e.Item.DataItem, "Content")
            End If

            ' assign the content
            Dim lblContent As Label = CType(e.Item.FindControl("lblContent"), Label)
            lblContent.Text = strContent
        End Sub

#End Region

#Region "Optional Interfaces"

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' Registers the module actions required for interfacing with the portal framework
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        ''' <history>
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions
            Get
                Dim Actions As New Entities.Modules.Actions.ModuleActionCollection
                Actions.Add(GetNextActionID, Localization.GetString(Entities.Modules.Actions.ModuleActionType.AddContent, LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "", EditUrl(), False, Security.SecurityAccessLevel.Edit, True, False)
                Return Actions
            End Get
        End Property

#End Region

    End Class

End Namespace

 

 

<%@ Control language="vb" Inherits="YourCompany.Modules.TBSMS.ViewTBSMS" AutoEventWireup="false" Explicit="True" Codebehind="ViewTBSMS.ascx.vb" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<asp:datalist id="lstContent" datakeyfield="ItemID" runat="server" cellpadding="4"><ItemTemplate>
<TABLE cellPadding=4 width="100%"><TBODY><TR><TD vAlign=top align=left width="100%"><asp:HyperLink id="HyperLink1" runat="server" Visible="<%# IsEditable %>" NavigateUrl='<%# EditURL("ItemID",DataBinder.Eval(Container.DataItem,"ItemID")) %>'><asp:Image ID="Image1" Runat=server ImageUrl="~/images/edit.gif" AlternateText="Edit" Visible="<%#IsEditable%>" resourcekey="Edit"/></asp:HyperLink> <asp:Label id="lblContent" runat="server" CssClass="Normal"></asp:Label> </TD></TR></TBODY></TABLE>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    <asp:TextBox ID="TextBox1" runat="server">abc</asp:TextBox>
</ItemTemplate>
</asp:datalist>&nbsp;&nbsp;

 
New Post 6/17/2008 8:21 AM
User is offline Mitch Sellers
5566 posts
www.mitchelsellers.com
3rd Ranked




Re: v13wstat3 Help! 

In your page load you need a check for

NOT IsPostback

THen ONLY execute the databinding if it evaluates to try, as you have it now every load and postback will re-bind the grid, loosing any edits.


-Mitchel Sellers
MCITP, MCPD, MCTS
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 6/18/2008 12:47 AM
User is offline Sam
3 posts
10th Ranked


Re: v13wstat3 Help! 

thanks for this, in the end i just removed the whole control and all the code that came with the template and it now works fine, just like a normal asp.net page would.

 

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Viewstate Help!
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


TMA Resources
TMA Resources is a software company providing eBusiness solutions for the Association market.
www.tmaresources.com
DotNetNuke Hosting Provider UK
UK leading DotNetNuke Hosting provider. Owned and operated by a Microsoft Gold Certified Partner.
www.DNN-Portals.co.uk
Alliance Systems & Programming Inc
Alliance is not just our name... it's how we do business. We partner with our clients, learning their business processes and standards and then applying our expertise to help them improve their workflow and profitability.
www.Alliancesys.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP