Solved

Server posting back......

Posted on 2004-10-25
207 Views
Last Modified: 2011-10-03
I am working on asp.net project(VB.net). When I try running the web page on my local machine it is posting back just fine. But when I am trying to run the same project from the server it is not posting back. Can some one help me out  on this matter.
0
Question by:niki_kiran
    6 Comments
     
    LVL 6

    Expert Comment

    by:Praesidium
    Post your code...
    0
     

    Author Comment

    by:niki_kiran
    this is the code :
    *********************************************

    #Region " Author's Comments "
    'Name:
    '   default.aspx.vb
    'Date:
    '   08/17/2004
    'Author:
    '   Kiran Nibbaragandla
    'Purpose:
    '   View and Create Campaigns and view/set their default commission levels
    'Required Files:
    '   default.aspx
    '   NCS.BusinessObjects.NCSReporting
    '   NCS.ClassLibraries.Data
    'Database Tables Used:
    '   Campaigns
    '   Commissions
    '   CardOffers
    '   AffiliatesCampaigns
    '   AffiliatesCardOffers
    'Stored Procedures Used:
    '   UpdateStatusIDCampaign
    '   UpdateEndDates
    '   UpdateCampaignCommission
    '   UpdateCampaignCommission1
    '   UpdateAffiliatesCampaigns
    '   UpdateCardOfferWhenCampaignUpdated
    '   UpdateAffiliateCampaignWithCampaignStatus
    '   UpdateAffiliateCardOfferWithCampaignStatus
    'Revisions:
    '   2004.08.17 - Kiran Nibbaragandla - FileCreated
    '   2004.10.18 - Kiran Nibbaragandla - Checking the Date effective for the newely created Campaign is same
    '                as the Date effective for the default Commission entered
    '   2004.10.18 - Kiran Nibbaragandla - Modified the code which makes use of Broker class instead of using
    '                plain SQL connections and adding paramenters
    '   2004.10.26 - Kiran Nibbaragandla - Added Minimize & Maximize buttons to the page
    #End Region

    Imports System.Data.SqlClient
    Imports System.Configuration

    Namespace NCS.Websites.NCSReporting.Admin.Campaigns
        Public Class _default
            Inherits NCS.Websites.NCSReporting.Admin.BasePageTemplate

            Protected WithEvents imgbutFirst As System.Web.UI.WebControls.ImageButton
            Protected WithEvents imgbutPrevious As System.Web.UI.WebControls.ImageButton
            Protected WithEvents imgbutNext As System.Web.UI.WebControls.ImageButton
            Protected WithEvents imgbutLast As System.Web.UI.WebControls.ImageButton
            Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel
            Protected WithEvents subSearchResults As System.Web.UI.WebControls.DataGrid
            Protected WithEvents imgbutFirst1 As System.Web.UI.WebControls.ImageButton
            Protected WithEvents imgbutPrevious1 As System.Web.UI.WebControls.ImageButton
            Protected WithEvents imgbutNext1 As System.Web.UI.WebControls.ImageButton
            Protected WithEvents imgbutLast1 As System.Web.UI.WebControls.ImageButton
            Protected WithEvents Panel2 As System.Web.UI.WebControls.Panel
            Public intID As Integer
            Protected WithEvents chkAffiliate As System.Web.UI.WebControls.CheckBox
            Protected WithEvents lblError2 As System.Web.UI.WebControls.Label
            Protected WithEvents valMaxPay As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents txtMaxPayout As System.Web.UI.WebControls.TextBox
            Protected WithEvents valTier4 As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents txtTier4 As System.Web.UI.WebControls.TextBox
            Protected WithEvents valT4Com As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents txtT4Commission As System.Web.UI.WebControls.TextBox
            Protected WithEvents chkRetro4 As System.Web.UI.WebControls.CheckBox
            Protected WithEvents lblError3 As System.Web.UI.WebControls.Label
            Protected WithEvents butMinimize As System.Web.UI.WebControls.ImageButton
            Protected WithEvents butMaximize As System.Web.UI.WebControls.ImageButton
            Protected WithEvents Panel3 As System.Web.UI.WebControls.Panel
            Public intCampaignID As Integer

    #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 btnSearch As System.Web.UI.WebControls.Button
            Protected WithEvents txtName As System.Web.UI.WebControls.TextBox
            Protected WithEvents txtDescription As System.Web.UI.HtmlControls.HtmlTextArea
            Protected WithEvents chkRetro3 As System.Web.UI.WebControls.CheckBox
            Protected WithEvents chkRetro2 As System.Web.UI.WebControls.CheckBox
            Protected WithEvents txtRecCount As System.Web.UI.WebControls.TextBox
            Protected WithEvents SearchResults As System.Web.UI.WebControls.DataGrid
            Protected WithEvents Label1 As System.Web.UI.WebControls.Label
            Protected WithEvents selPageItems As System.Web.UI.WebControls.DropDownList
            Protected WithEvents txtTier1 As System.Web.UI.WebControls.TextBox
            Protected WithEvents txtT1Commission As System.Web.UI.WebControls.TextBox
            Protected WithEvents txtTier2 As System.Web.UI.WebControls.TextBox
            Protected WithEvents txtT2Commission As System.Web.UI.WebControls.TextBox
            Protected WithEvents txtTier3 As System.Web.UI.WebControls.TextBox
            Protected WithEvents txtT3Commission As System.Web.UI.WebControls.TextBox
            Protected WithEvents lblError As System.Web.UI.WebControls.Label
            Protected WithEvents lblPageCount As System.Web.UI.WebControls.Label
            Protected WithEvents lblErrorEdit As System.Web.UI.WebControls.Label
            Protected WithEvents Calendarpopup1 As eWorld.UI.CalendarPopup
            Protected WithEvents clndEnd As eWorld.UI.CalendarPopup
            Protected WithEvents clndBegin1 As eWorld.UI.CalendarPopup
            Protected WithEvents clndBegin As eWorld.UI.CalendarPopup
            Protected WithEvents clndEnd1 As eWorld.UI.CalendarPopup
            Protected WithEvents txtCampaignName As System.Web.UI.WebControls.TextBox
            Protected WithEvents cancelCampaign As System.Web.UI.WebControls.Button
            Protected WithEvents saveCommission As System.Web.UI.WebControls.Button
            Protected WithEvents valTier1 As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents valTier2 As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents valTier3 As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents valT1Com As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents valT2Com As System.Web.UI.WebControls.RegularExpressionValidator
            Protected WithEvents valT3Com As System.Web.UI.WebControls.RegularExpressionValidator

            '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

            Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                Try
                    If Not Page.IsPostBack Then
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateStatusIDCampaign()
                        'NCS.BusinessObjects.NCSReporting.Broker.UpdateAffiliatesCampaignswithCampaignsStatusID()
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateEndDates()
                        butMaximize.Visible = False
                        butMinimize.Visible = True
                    End If
                Catch ex As Exception
                    'Me.lblError.Text = ex.Message.ToString()
                Finally

                End Try

            End Sub
            Private Sub Page_MyPreRender(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
                'Me.objHeader.PageTitle = "Manage Campaigns"

            End Sub
            Sub Repage(ByVal sender As Object, ByVal e As EventArgs)
                SearchResults.CurrentPageIndex = 0
                'BindSQL()
            End Sub

            Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

                SearchResults.CurrentPageIndex = 0
                txtName.Text = ""
                txtDescription.Value = ""
                txtTier1.Text = ""
                txtTier2.Text = ""
                txtTier3.Text = ""
                txtTier4.Text = ""
                txtT1Commission.Text = ""
                txtT2Commission.Text = ""
                txtT3Commission.Text = ""
                txtT4Commission.Text = ""
                txtMaxPayout.Text = ""
                chkRetro2.Checked = False
                chkRetro3.Checked = False
                chkRetro4.Checked = False
                chkAffiliate.Checked = True
                clndEnd.SelectedDate = "01/01/3000"
                clndEnd1.SelectedDate = "01/01/3000"
                butMaximize.Visible = True
                butMinimize.Visible = False

                viewstate("intCampaignID") = 0
                viewstate("intID") = 0

                Panel1.Visible = False
                Panel2.Visible = True
                Panel3.Visible = False

                BindSQL()
            End Sub

            Sub BindSQL()

                Dim rCount As Integer
                Dim dvGetAffData As New DataView

                Try

                    dvGetAffData.Table = GetTableData()
                    SearchResults.AutoGenerateColumns = False

                    dvGetAffData.RowFilter = "CampaignName LIKE '%" & Trim(txtCampaignName.Text) & "%'"

                    SearchResults.PageSize = selPageItems.SelectedValue

                    SearchResults.DataSource = Nothing
                    SearchResults.DataBind()
                    SearchResults.DataSource = dvGetAffData
                    SearchResults.DataBind()

                    SearchResults.PageSize = selPageItems.SelectedValue

                    rCount = dvGetAffData.Count.ToString

                    txtRecCount.Text = rCount & " records found!"

                    lblPageCount.Text = "Page " & SearchResults.CurrentPageIndex + 1 & " of " & SearchResults.PageCount.ToString()

                Catch ex As Exception
                    'Me.lblError.Text = ex.Message.ToString()
                Finally
                    'Con.Close()
                End Try

            End Sub

            Sub BindSQL1()

                Dim dvGetAffData1 As New DataView

                Try

                    dvGetAffData1.Table = GetTableData1()
                    subSearchResults.AutoGenerateColumns = False

                    subSearchResults.DataSource = Nothing
                    subSearchResults.DataBind()
                    subSearchResults.DataSource = dvGetAffData1
                    subSearchResults.DataBind()

                Catch ex As Exception
                    'Me.lblError.Text = ex.Message.ToString()
                Finally
                    'Con.Close()
                End Try

            End Sub
            Public Function GetTableData() As DataTable
                Dim strCampaignName As String = Trim(txtCampaignName.Text)
                Dim daGetAffData As SqlDataAdapter = New SqlDataAdapter
                Dim dsGetAffData As DataSet = New DataSet
                Dim Con As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
                Try
                    daGetAffData.SelectCommand = New SqlCommand("SELECT      * FROM Campaigns WHERE      CampaignName LIKE '%" + strCampaignName + "%' ORDER BY CampaignName", Con)
                    daGetAffData.SelectCommand.Connection = Con
                    daGetAffData.SelectCommand.Connection.Open()
                    daGetAffData.Fill(dsGetAffData, "MyTable")

                    Return dsGetAffData.Tables("MyTable")
                Catch ex As Exception
                    Throw ex
                Finally
                    Con.Close()
                End Try
            End Function
            Public Function GetTableData1() As DataTable

                Dim intTemp As Integer
                Dim strTemp As String
                intTemp = viewstate("intCampaignID")
                strTemp = intTemp.ToString()
                Dim daGetAffData As SqlDataAdapter = New SqlDataAdapter
                Dim dsGetAffData As DataSet = New DataSet
                Dim Con As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
                Try
                    daGetAffData.SelectCommand = New SqlCommand("SELECT      * FROM Commissions WHERE CampaignID = @strTemp ORDER BY CommissionID", Con)
                    daGetAffData.SelectCommand.Parameters.Add("@strTemp", strTemp)
                    daGetAffData.SelectCommand.Connection = Con
                    daGetAffData.SelectCommand.Connection.Open()
                    daGetAffData.Fill(dsGetAffData, "MyTable1")

                    Return dsGetAffData.Tables("MyTable1")
                Catch ex As Exception
                    Throw ex
                Finally
                    Con.Close()
                End Try
            End Function

            Sub dg_Page(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
                SearchResults.CurrentPageIndex = e.NewPageIndex
                BindSQL()
            End Sub
            Sub dg_Page1(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
                subSearchResults.CurrentPageIndex = e.NewPageIndex
                BindSQL1()
            End Sub

            Sub dg_Edit(ByVal s As Object, ByVal e As DataGridCommandEventArgs)

                viewstate("intCampaignID") = SearchResults.DataKeys(e.Item.ItemIndex)

                txtName.Text = e.Item.Cells(0).Text
                clndBegin.SelectedDate = e.Item.Cells(1).Text
                clndEnd.SelectedDate = e.Item.Cells(2).Text
                txtDescription.Value = e.Item.Cells(3).Text
                chkAffiliate.Checked = e.Item.Cells(5).Text

                BindSQL1()

                Panel1.Visible = True
                Panel2.Visible = False

            End Sub

            Sub cancel_Campaign(ByVal sender As System.Object, ByVal e As System.EventArgs)
                txtName.Text = ""
                txtDescription.Value = ""
                txtTier1.Text = ""
                txtTier2.Text = ""
                txtTier3.Text = ""
                txtTier4.Text = ""
                txtT1Commission.Text = ""
                txtT2Commission.Text = ""
                txtT3Commission.Text = ""
                txtT4Commission.Text = ""
                txtMaxPayout.Text = ""
                chkRetro2.Checked = False
                chkRetro3.Checked = False
                chkRetro4.Checked = False
                chkAffiliate.Checked = True
                viewstate("intCampaignID") = 0
                viewstate("intID") = 0
                clndEnd.SelectedDate = "01/01/3000"
                clndEnd1.SelectedDate = "01/01/3000"
                Panel1.Visible = False
                Panel2.Visible = False
                lblError2.Text = ""
            End Sub

            Sub save_Commission(ByVal sender As System.Object, ByVal e As System.EventArgs)
                Dim CampaignID As Integer
                Dim intID1 As Integer
                Dim intCamp As Integer
                Dim objCmd As SqlCommand
                Dim Con As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
                Dim fNewCampaign As Boolean

                'Checking if there is any data in the tier levels if the retro check box''''''''''''''''''''''
                'for that specific level is checked. Don't allow the user to save if there
                'is no data in that commission level and the retro is checked
                Dim retroFlag As Boolean
                retroFlag = True
                If (viewstate("intCampaignID") <> 0) And (viewstate("intID") = 0) Then

                Else
                    If chkRetro2.Checked = True Then
                        If txtT2Commission.Text = "" Or txtTier2.Text = "" Then
                            lblError2.Text = "T2Commission or Tier2 MUST be entered for it to be Retroactive. "
                            retroFlag = False
                        End If
                        If txtT2Commission.Text <> "" Or txtTier2.Text <> "" Then
                            If CDbl(txtT2Commission.Text) = 0 Or CInt(txtTier2.Text) = 0 Then
                                lblError2.Text = "T2Commission or Tier2 MUST be entered for it to be Retroactive. "
                                retroFlag = False
                            End If
                        End If
                    End If
                    If chkRetro3.Checked = True Then
                        If txtT3Commission.Text = "" Or txtTier3.Text = "" Then
                            lblError2.Text = "T3Commission or Tier3 MUST be entered for it to be Retroactive. "
                            retroFlag = False
                        End If
                        If txtT2Commission.Text <> "" Or txtTier2.Text <> "" Then
                            If CDbl(txtT3Commission.Text) = 0 Or CInt(txtTier3.Text) = 0 Then
                                lblError2.Text = "T3Commission or Tier3 MUST be entered for it to be Retroactive. "
                                retroFlag = False
                            End If
                        End If
                    End If
                    If chkRetro4.Checked = True Then
                        If txtT4Commission.Text = "" Or txtTier4.Text = "" Then
                            lblError2.Text = "T4Commission or Tier4 MUST be entered for it to be Retroactive. "
                            retroFlag = False
                        End If
                        If txtT4Commission.Text <> "" Or txtTier4.Text <> "" Then
                            If CDbl(txtT4Commission.Text) = 0 Or CInt(txtTier4.Text) = 0 Then
                                lblError2.Text = "T4Commission or Tier4 MUST be entered for it to be Retroactive. "
                                retroFlag = False
                            End If
                        End If
                    End If
                End If
                ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                If txtTier1.Text = "" Then
                    txtTier1.Text = 0
                End If
                If txtTier2.Text = "" Then
                    txtTier2.Text = 0
                End If
                If txtTier3.Text = "" Then
                    txtTier3.Text = 0
                End If
                If txtTier4.Text = "" Then
                    txtTier4.Text = 0
                End If
                If txtT1Commission.Text = "" Then
                    txtT1Commission.Text = 0
                End If
                If txtT2Commission.Text = "" Then
                    txtT2Commission.Text = 0
                End If
                If txtT3Commission.Text = "" Then
                    txtT3Commission.Text = 0
                End If
                If txtT4Commission.Text = "" Then
                    txtT4Commission.Text = 0
                End If
                If txtMaxPayout.Text = "" Then
                    txtMaxPayout.Text = 0
                End If

                Try
                    ''''''''''''''''''''Checking the rules for Commissions''''''''''''''''''''''''''''''''''''''

                    Dim intTier1, intTier2, intTier3, intTier4 As Integer
                    Dim dblComm1, dblComm2, dblComm3, dblComm4, dblMaxPayout As Double
                    Dim flagExit As Boolean
                    intTier1 = System.Convert.ToInt64(txtTier1.Text)
                    intTier2 = System.Convert.ToInt64(txtTier2.Text)
                    intTier3 = System.Convert.ToInt64(txtTier3.Text)
                    intTier4 = System.Convert.ToInt64(txtTier4.Text)
                    'Response.Write(intTier1 & " " & intTier2 & " " & intTier3)
                    dblComm1 = System.Convert.ToDouble(txtT1Commission.Text)
                    dblComm2 = System.Convert.ToDouble(txtT2Commission.Text)
                    dblComm3 = System.Convert.ToDouble(txtT3Commission.Text)
                    dblComm4 = System.Convert.ToDouble(txtT4Commission.Text)
                    dblMaxPayout = System.Convert.ToDouble(txtMaxPayout.Text)
                    flagExit = False

                    If (viewstate("intCampaignID") <> 0) And (viewstate("intID") = 0) Then

                    Else
                        If intTier1 <= 0 Or dblComm1 <= 0 Then
                            flagExit = True
                            'Response.Write("tier1 or commission1 can't be 0")
                            lblError2.Text = "Tier1 or T1Commission MUST be greater than Zero. "
                        End If
                        If intTier3 <> 0 Or dblComm3 <> 0 Then
                            If intTier2 = 0 Or dblComm2 = 0 Then
                                flagExit = True
                                lblError2.Text = " Tier2 or T2Commission MUST be entered. "
                            End If
                        End If
                        If intTier4 <> 0 Or dblComm4 <> 0 Then
                            If intTier3 = 0 Or dblComm3 = 0 Then
                                flagExit = True
                                lblError2.Text = " Tier3 or T3Commission MUST be entered. "
                            End If
                        End If
                        '''''''''''''''''''''''''''''''''''''''''''''''''
                        If intTier2 <> 0 Or dblComm2 <> 0 Then
                            If intTier2 < intTier1 Or dblComm2 < dblComm1 Then
                                flagExit = True
                                lblError2.Text = "Tier2/T2Commission MUST be greater than Tier1/T1Commission. "
                            End If
                        End If
                        If intTier3 <> 0 Or dblComm3 <> 0 Then
                            If intTier3 < intTier2 Or dblComm3 < dblComm2 Then
                                flagExit = True
                                lblError2.Text = "Tier3/T3Commission MUST be greater than Tier2/T2Commission. "
                            End If
                        End If
                        If intTier4 <> 0 Or dblComm4 <> 0 Then
                            If intTier4 < intTier3 Or dblComm4 < dblComm3 Then
                                flagExit = True
                                lblError2.Text = "Tier4/T4Commission MUST be greater than Tier3/T3Commission. "
                            End If
                        End If
                        '''''''''''''''''''''''''''''''''''''''''''''''''
                        If intTier1 <> 0 And intTier2 <> 0 Then
                            If intTier2 < intTier1 Then
                                flagExit = True
                                lblError2.Text = " Tier2 MUST be greater than Tier1. "
                            End If
                        End If
                        If intTier2 <> 0 And intTier3 <> 0 Then
                            If intTier3 < intTier2 Then
                                flagExit = True
                                lblError2.Text = " Tier3 MUST be greater than Tier2. "
                            End If
                        End If
                        If intTier3 <> 0 And intTier4 <> 0 Then
                            If intTier4 < intTier3 Then
                                flagExit = True
                                lblError2.Text = " Tier4 MUST be greater than Tier3. "
                            End If
                        End If
                        If dblComm1 <> 0 And dblComm2 <> 0 Then
                            If dblComm2 < dblComm1 Then
                                flagExit = True
                                lblError2.Text = " T2 Commission MUST be greater than T1 Commission. "
                            End If
                        End If
                        If dblComm2 <> 0 And dblComm3 <> 0 Then
                            If dblComm3 < dblComm2 Then
                                flagExit = True
                                lblError2.Text = " T3 Commission MUST be greater than T2 Commission. "
                            End If
                        End If
                        If dblComm3 <> 0 And dblComm4 <> 0 Then
                            If dblComm4 < dblComm3 Then
                                flagExit = True
                                lblError2.Text = " T4 Commission MUST be greater than T3 Commission. "
                            End If
                        End If
                        If dblMaxPayout <= 0 Then
                            flagExit = True
                            lblError2.Text = " MaxPayout MUST be greater than Zero. "
                        End If
                        If dblMaxPayout < dblComm1 Or dblMaxPayout < dblComm2 Or dblMaxPayout < dblComm3 Or dblMaxPayout < dblComm4 Then
                            flagExit = True
                            lblError2.Text = "MaxPayout MUST be greater than all the Tier Commissions. "
                        End If
                    End If
                    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                    Dim flagExit1 As Boolean
                    flagExit1 = False
                    If clndBegin.SelectedDate <> clndBegin1.SelectedDate Then
                        flagExit1 = True
                        lblError2.Text = "Date Effective for the Campaign and default Commission MUST match"
                    End If
                    If flagExit1 = True And (viewstate("intCampaignID") = 0) Then
                        GoTo Last2
                    End If
                    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                    If flagExit = False And retroFlag = True Then
                        lblError2.Text = ""
                        CampaignID = Convert.ToInt32(viewstate("intCampaignID"))
                        intID1 = Convert.ToInt32(viewstate("intID"))
                        fNewCampaign = False
                        If (viewstate("intCampaignID") = 0) And (viewstate("intID") = 0) Then
                            fNewCampaign = True
                            NCS.BusinessObjects.NCSReporting.Broker.UpdateCampaignCommission(CampaignID, Trim(txtName.Text), txtDescription.Value, clndBegin.SelectedDate, clndEnd.SelectedDate, IIf(chkAffiliate.Checked = True, 1, 0))

                            BindSQL()
                            Dim readCampaign1 As SqlDataReader
                            readCampaign1 = NCS.BusinessObjects.NCSReporting.Broker.GetCampaignID(Trim(txtName.Text))
                            While (readCampaign1.Read())
                                intCamp = readCampaign1("CampaignID")
                                'intCamp contains the newly created CampaignID to be inserted in Commissions tablef
                            End While
                            NCS.BusinessObjects.NCSReporting.Broker.UpdateCampaignCommission1(intID1, intCamp, txtTier1.Text, txtTier2.Text, txtTier3.Text, txtTier4.Text, Convert.ToDecimal(txtT1Commission.Text), Convert.ToDecimal(txtT2Commission.Text), Convert.ToDecimal(txtT3Commission.Text), Convert.ToDecimal(txtT4Commission.Text), IIf(chkRetro2.Checked = True, 1, 0), IIf(chkRetro3.Checked = True, 1, 0), IIf(chkRetro4.Checked = True, 1, 0), Convert.ToDecimal(txtMaxPayout.Text), clndBegin1.SelectedDate, clndEnd1.SelectedDate)
                            BindSQL1()
                        End If
                        If (viewstate("intCampaignID") <> 0) And (viewstate("intID") = 0) Then
                            NCS.BusinessObjects.NCSReporting.Broker.UpdateCampaignCommission(CampaignID, Trim(txtName.Text), txtDescription.Value, clndBegin.SelectedDate, clndEnd.SelectedDate, IIf(chkAffiliate.Checked = True, 1, 0))
                            BindSQL()
                        End If
                        If (viewstate("intCampaignID") <> 0) And (viewstate("intID") <> 0) Then
                            NCS.BusinessObjects.NCSReporting.Broker.UpdateCampaignCommission(CampaignID, Trim(txtName.Text), txtDescription.Value, clndBegin.SelectedDate, clndEnd.SelectedDate, IIf(chkAffiliate.Checked = True, 1, 0))
                            BindSQL()
                            NCS.BusinessObjects.NCSReporting.Broker.UpdateCampaignCommission1(intID1, CampaignID, txtTier1.Text, txtTier2.Text, txtTier3.Text, txtTier4.Text, Convert.ToDecimal(txtT1Commission.Text), Convert.ToDecimal(txtT2Commission.Text), Convert.ToDecimal(txtT3Commission.Text), Convert.ToDecimal(txtT4Commission.Text), IIf(chkRetro2.Checked = True, 1, 0), IIf(chkRetro3.Checked = True, 1, 0), IIf(chkRetro4.Checked = True, 1, 0), Convert.ToDecimal(txtMaxPayout.Text), clndBegin1.SelectedDate, clndEnd1.SelectedDate)
                            BindSQL1()
                        End If
                        ''''''''''Change the status of all the card offers whose''''''''''''''''''''''''''''''''''''''
                        ''''''''''Campaigns status is changed'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateStatusIDCampaign()
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateEndDates()
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateEndDatesforCreativesWhenCampaignChanged()
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateEndDatesforCreativesWhenCardOfferChanged()
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateCardOfferWhenCampaignUpdated()
                        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                        '''''''''Change the Enddates for banners and text if end date for campaign is changed'''''''''
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateEndDatesforCreativesWhenCampaignChanged()
                        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                        '''''''''''''''''''''''''''INSERTING NEW CAMPAIGN ID IN AFFILIATESCAMPAIGNS TABLE'''''''''''''
                        If fNewCampaign = True And clndBegin.SelectedDate = Date.Today Then
                            NCS.BusinessObjects.NCSReporting.Broker.UpdateAffiliatesCampaigns(intCamp)
                        End If
                        '''''''''''''Updating AffiliatesCampaign Status with Campaigns Status'''''''''''''''''''''''''
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateAffiliateCampaignWithCampaignStatus()
                        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                        '''''''''''''Updating AffiliatesCardOffer Status with Cmapaigns Status''''''''''''''''''''''''
                        NCS.BusinessObjects.NCSReporting.Broker.UpdateAffiliateCardOfferWithCampaignStatus()
                        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                        viewstate("intCampaignID") = 0
                        viewstate("intiD") = 0
                        lblError2.Text = ""
                    End If
    Last2:
                Catch ex As Exception
                    Response.Write(ex.Message)
                End Try

            End Sub

            Private Sub selPageItems_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selPageItems.SelectedIndexChanged
                BindSQL()
            End Sub
            Sub dg_Edit1(ByVal s As Object, ByVal e As DataGridCommandEventArgs)

                viewstate("intID") = subSearchResults.DataKeys(e.Item.ItemIndex)

                If e.Item.Cells(11).Text < Date.Today Then
                    lblError3.Text = "Cannot Edit this Record!!!"
                    txtTier1.Text = ""
                    txtTier2.Text = ""
                    txtTier3.Text = ""
                    txtTier4.Text = ""
                    txtT1Commission.Text = ""
                    txtT2Commission.Text = ""
                    txtT3Commission.Text = ""
                    txtT4Commission.Text = ""
                    txtMaxPayout.Text = ""
                    chkRetro2.Checked = False
                    chkRetro3.Checked = False
                    chkRetro4.Checked = False
                Else
                    txtTier1.Text = e.Item.Cells(2).Text
                    txtTier2.Text = e.Item.Cells(4).Text
                    txtTier3.Text = e.Item.Cells(6).Text
                    txtTier4.Text = e.Item.Cells(12).Text
                    txtT1Commission.Text = e.Item.Cells(3).Text
                    txtT2Commission.Text = e.Item.Cells(5).Text
                    txtT3Commission.Text = e.Item.Cells(7).Text
                    txtT4Commission.Text = e.Item.Cells(13).Text
                    clndBegin1.SelectedDate = e.Item.Cells(1).Text
                    clndEnd1.SelectedDate = e.Item.Cells(11).Text
                    chkRetro2.Checked = e.Item.Cells(8).Text
                    chkRetro3.Checked = e.Item.Cells(9).Text
                    chkRetro4.Checked = e.Item.Cells(14).Text
                    txtMaxPayout.Text = e.Item.Cells(10).Text
                    lblError3.Text = ""
                End If
                Panel2.Visible = False
                Panel3.Visible = True
                butMinimize.Visible = True
                butMaximize.Visible = False

            End Sub


            Private Sub imgbutLast_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbutLast.Click
                SearchResults.CurrentPageIndex = (SearchResults.PageCount - 1)
                BindSQL()
            End Sub

            Private Sub imgbutPrevious_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbutPrevious.Click
                If (SearchResults.CurrentPageIndex > 0) Then
                    SearchResults.CurrentPageIndex -= 1
                    BindSQL()
                End If
            End Sub

            Private Sub imgbutNext_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbutNext.Click
                If (SearchResults.CurrentPageIndex < (SearchResults.PageCount - 1)) Then
                    SearchResults.CurrentPageIndex += 1
                    BindSQL()
                End If
            End Sub

            Private Sub imgbutFirst_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbutFirst.Click
                SearchResults.CurrentPageIndex = 0
                BindSQL()
            End Sub

            Private Sub imgbutFirst1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)
                subSearchResults.CurrentPageIndex = 0
                BindSQL1()
            End Sub

            Private Sub imgbutPrevious1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)
                If (subSearchResults.CurrentPageIndex > 0) Then
                    subSearchResults.CurrentPageIndex -= 1
                    BindSQL1()
                End If
            End Sub

            Private Sub imgbutNext1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)
                If (subSearchResults.CurrentPageIndex < (subSearchResults.PageCount - 1)) Then
                    subSearchResults.CurrentPageIndex += 1
                    BindSQL1()
                End If
            End Sub

            Private Sub imgbutLast1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)
                subSearchResults.CurrentPageIndex = (subSearchResults.PageCount - 1)
                BindSQL1()
            End Sub

            Private Sub SearchResults_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles SearchResults.ItemDataBound

                Try

                    If (Convert.ToInt32(e.Item.Cells(4).Text = 0)) Then
                        e.Item.Cells(4).Text = "Inactive"
                    Else
                        e.Item.Cells(4).Text = "Active"
                    End If
                Catch ex As Exception

                End Try

            End Sub

            Private Sub butMinimize_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles butMinimize.Click
                Try
                    Panel3.Visible = False
                    butMinimize.Visible = False
                    butMaximize.Visible = True
                Catch ex As Exception
                    Response.Write(ex.Message)
                End Try
            End Sub

            Private Sub butMaximize_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles butMaximize.Click
                Try
                    Panel3.Visible = True
                    butMaximize.Visible = False
                    butMinimize.Visible = True
                Catch ex As Exception
                    Response.Write(ex.Message)
                End Try
            End Sub

        End Class
    End Namespace
    ********************************************************

    Its working fine on my local machine. I tried to just display a message when a button is clicked on this machine. Its not working when i upload this to the server, works just fine on my local machine. I want this to be done ASAP.....i can't figure this out.....
    0
     

    Author Comment

    by:niki_kiran
    hi Praesidium ......can you figure out what the problem was????
    0
     
    LVL 6

    Expert Comment

    by:Praesidium
    Hrm...  your code looks okay to me.  A little on the verbose side, but that never hurt anything.  Instead of declaring System.Web.UI.WebControls so many times, why not just add a Using System.Web.UI.WebControls tag...  What operating system is your PC / Server?  Is this a code-behind or an inherited class?  
    0
     
    LVL 18

    Accepted Solution

    by:
    Check out that .Net Framework is installed properly on your server. The only reson behind such problem is your code cannot find aspnet_client Folder properly.

    -tushar
    0
     

    Author Comment

    by:niki_kiran
    i think i figured out the problem. For some reason my application is not working with validations. The pages which don't have validations works fine. So I used this tag ClientTarget="Downlevel" in my html side...now everything seems to work fine...
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Learn The Basics of Ethical Hacking & Pen Testing

    Computer and network security is one of the fastest growing and most essential industries in technology, meaning companies will pay big bucks for ethical hackers. This is the perfect course to leap into this lucrative career, learning how to use ethical hacking to reveal ...

    Suggested Solutions

    Title # Comments Views Activity
    Magento Indexing 1 33
    CSS3 siblings and first-child 3 25
    Wordpress Changes urls 6 20
    Use wordpress as website, no categories 11 23
    Are you into PHP development and curious how you can make your life easier when publishing your website? Do you sometimes worry you might forget to remove debug lines? Or you spend unnecessary time to double check you haven't accidentally uploaded '…
    The first time you look at a web page and its source code, you are probably a little intimidated by the use of symbols and jargon that really looks foreign to you. You might not even know where to start to begin learning what it all means. That’…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now