Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Dropdown index getting errorDropdown index getting error
Previous
 
Next
New Post
1/11/2008 3:12 PM
 

Even if I do select a different item and them click submit I am getting an error.

 
New Post
1/11/2008 4:18 PM
 

That's strange - and shoots down that theory. Please post your Page_Load handler code showing the IsPostback block and where the DDL is being databound. Also check that Cache Duration time is set to 0 in the module's settings and to 0 or -1 (preferably) in the Module Definitions.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/14/2008 5:23 PM
 

Imports System.Data
Imports System.Data.SqlClient
Imports DotNetNuke.Common
Imports DotNetNuke
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Data
Imports DotNetNuke.Entities.Users
Imports DotNetNuke.Framework
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.UI

Namespace DotNetNuke
    Partial Class DispHierarchyS
        Inherits DotNetNuke.Entities.Modules.PortalModuleBase

        Dim vAgentid As String

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Request.Params("agentid") Is Nothing Then
                Dim poPageController As New Entities.Tabs.TabController
                Dim pnTabID As Integer = poPageController.GetTabByName("Agent Search", PortalSettings.PortalId).TabID
                Dim psURL As String = NavigateURL(pnTabID)
                Session("RetTab") = TabId
                Response.Redirect(psURL)
            Else
                Dim objEventLog As New Services.Log.EventLog.EventLogController
                objEventLog.AddLog("DDValue", ddlMC.SelectedIndex.ToString, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ + ddlMC.SelectedItem.Value)
        End Sub

    End Class
End Namespace

 
New Post
1/16/2008 12:10 PM
 

I'm having a bit of trouble seeing how the above Page_Load relates to the problem as you initially presented it. Is this code from the same control which contains the bttMC_Click handler code which you posted earlier or is it from the control which is the target of the redirection? My guess is the latter.  In either case, where is the code for databinding the ddlMC dropdown particularly that in the main control which is doing the redirect following the button click.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/16/2008 12:25 PM
 

Sorry about that, don't know what happened:

 

Imports System.Data
Imports System.Data.SqlClient
Imports DotNetNuke.Common
Imports DotNetNuke
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Data
Imports DotNetNuke.Entities.Users
Imports DotNetNuke.Framework
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.UI


Namespace DotNetNuke
    Partial Class DispHierarchyS
        Inherits DotNetNuke.Entities.Modules.PortalModuleBase


        Dim vAgentid As String

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Request.Params("agentid") Is Nothing Then
                Dim poPageController As New Entities.Tabs.TabController
                Dim pnTabID As Integer = poPageController.GetTabByName("Agent Search", PortalSettings.PortalId).TabID
                Dim psURL As String = NavigateURL(pnTabID)
                Session("RetTab") = TabId
                Response.Redirect(psURL)
            Else
                vAgentid = Request.Params("agentid")
                If Not IsPostBack Then
                    GetMC()
                End If
                End If
        End Sub
      

        Private Sub GetMC()
            Dim vCount As Integer
            Dim vMC As String
            Dim AgentConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("YourAppSettings").ConnectionString)
            Dim dbCommandMC As SqlCommand = New SqlCommand("dbo.spHIERGetMarketCodes", AgentConn)
            If Request.Params("agentid") <> "" Then
                dbCommandMC.Parameters.Add(New SqlParameter("@pAgentNum", Request.Params("agentid")))
            Else
                dbCommandMC.Parameters.Add(New SqlParameter("@pAgentNum", vAgentid.ToUpper))
            End If

            dbCommandMC.CommandType = CommandType.StoredProcedure

            Dim Ds As New DataSet
            Dim SqlAdp As New SqlDataAdapter

            SqlAdp = New SqlDataAdapter(dbCommandMC)
            SqlAdp.Fill(Ds, "MC")

            Dim dt As DataTable
            dt = Ds.Tables("MC")
            vCount = dt.Rows.Count

            If (vCount = 1) Then
                vMC = "1"
            Else
                ddlMC.DataSource = Ds.Tables("MC")
                ddlMC.DataTextField = "description"
                ddlMC.DataValueField = "marketCode"
                ddlMC.DataBind()
               
            End If

            Dim mytabid As Integer
            Dim myUrl As String
            Try
                mytabid = Me.PortalSettings.ActiveTab.TabID
                myUrl = Me.PortalSettings.HomeDirectory
            Catch
                mytabid = 0
            End Try

            If (vCount = 1) Then
                Response.Redirect(Trim(myUrl) + "/tabid/" + Trim(Str(mytabid)) + "/Default.aspx?Agentid=" + Request.Params("agentid") + "&mc=" + vMC)
            End If
        End Sub
     
        Private Sub butMC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butMC.Click
            Dim objModules As Entities.Modules.ModuleController = New Entities.Modules.ModuleController
            Response.Redirect(Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "HierDetails", "mid=" & objModules.GetModuleByDefinition(PortalSettings.PortalId, "Agent Hierarchy").ModuleID) & "?agentid=" + Request.Params("AgentID") + "&mc=" + ddlMC.SelectedIndex.ToString)

        End Sub
    End Class
End Namespace

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Dropdown index getting errorDropdown index getting error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out