Link to home
Start Free TrialLog in
Avatar of kdeutsch
kdeutschFlag for United States of America

asked on

Aspx page looses css sytles when coming from another aspx page

Really weird problem I am running into.  When I load my main aspx page it comes up just fine with all the css styling intact and all fucntions on the page work.  however when i come from another page and pass a vlue to my main page to automatically load information it looses all styling and none of the ajax toolkit things work on the page.  As soon as I post back the page everything return to normal.  It is just when I pass a value into the page to load from another aspx page.  Never had this happen beofer and its quite perplexing.

I am using a master page with both page but that is not affected at all it just the css on the form where i am showing data.
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Does changing the value that you pass having any effect? What do you load and where?
We can't do much more than guess unless you post a link to the page.

Cd&
Avatar of kdeutsch

ASKER

COBOLdinasaur,

Would not do you much good to post a link since you will not be able to get to our internal network.
Codecruiser,

the value has no effect on the page, any value I put in does the same thing, wiwh I could post link but internal site and you cannot access.

Never ween before where passing a value though a query string and then loadding the page has an affect on the loading of the values.


 Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim Username As String = Split(Current.User.Identity.Name, "\")(1)
            Dim Appname As Label = CType(Master.FindControl("lblAppName"), Label)
            Appname.Text = " - Manage Processors"

            'Get the user and assign
            HFPersId.Value = GetPersId(Username)

            Dim Info As Integer = Convert.ToInt32(Request.QueryString("Info"))
           
            If Info > 0 Then
                 FillDDLs()    'Fills all the dropdown lists on the page
                LoadRecruit(Info)  'Fills the applicants info if value was passed.
            End If
        End If
    End Sub
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
CodeCruiser,

Actually i took this part out of the If not ispostback and now it works just fine.
 If Info > 0 Then
            FillDDLs()
            LoadRecruit(Info)
            HFRecruit.Value = Info
        End If



Full page load
 Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim Info As Integer = Convert.ToInt32(Request.QueryString("Info"))

        If Info > 0 Then
            FillDDLs()
            LoadRecruit(Info)
            HFRecruit.Value = Info
        End If

        If Not IsPostBack Then
            Dim Username As String = Split(Current.User.Identity.Name, "\")(1)
            Dim Appname As Label = CType(Master.FindControl("lblAppName"), Label)
            Appname.Text = " - Manage Processors"

            'Get the user and assign
            HFPersId.Value = GetPersId(Username)
        End If
    End Sub
well I am wrong now that just messes up my saves on the page as it no longer is able to save data on the form.
Ok,
DDl just loads all my Dropdown list in the pograms.


 Private Sub FillDDLs()
        'Fill all the drop down lists on new processor click or on a person load.

        sql = "SELECT UPC, UIC FROM OPENQUERY(SIDPERS, 'Select UPC, UPC || ''( '' || UNAME || '' )'' UIC from SIDPERS.PERS_UNIT_TBL where OESTS in (''M'', ''N'') order by UPC')"

        ddlUic.Items.Add(New ListItem("Pick Unit", "0"))
        buildDD(sql, ddlUic)

        sql = "select intTrainID, strTrainOption from TrainOption where bitActive = 1 order by strTrainOption"
        ddlTrainOption.Items.Add(New ListItem("Pick Train Option", "0"))
        buildDD(sql, ddlTrainOption)

        sql = "select intOtherOptID, strOtherOpt from OtherOptions where bitActive = 1 order by strOtherOpt"
        buildDD(sql, cbOtherOptions)
    End Sub


LoadRecruit just loads the information on a potential employee
 Private Sub LoadRecruit(ByVal RecruitId As Integer)

        sql = "sql statement pull"

        myDataTable = New DataTable
        myDataTable = getReader(sql)

        If myDataTable.Rows.Count > 0 Then
            HFRecruit.Value = RecruitId  'Did this for when they come from another page otherwise not needed.
            ddlRecruiter.SelectedValue = myDataTable.Rows(0)(0)
            txtLName.Text = myDataTable.Rows(0)(1)
            txtFName.Text = myDataTable.Rows(0)(2)
            txtMName.Text = myDataTable.Rows(0)(3)
            txtSSN.Text = myDataTable.Rows(0)(4)
            rblSex.SelectedValue = myDataTable.Rows(0)(5)
            txtAddress.Text = myDataTable.Rows(0)(6)
            txtCity.Text = myDataTable.Rows(0)(7)
            ddlState.SelectedValue = myDataTable.Rows(0)(8)
            txtZip.Text = myDataTable.Rows(0)(9)
            txtPhone.Text = myDataTable.Rows(0)(10)
            txtEmail.Text = myDataTable.Rows(0)(11)
            txtDtProcessing.Text = myDataTable.Rows(0)(12)
            ddlPayGrade.SelectedValue = myDataTable.Rows(0)(13)
            txtAFQT.Text = myDataTable.Rows(0)(14)
            txtPreAfqt.Text = myDataTable.Rows(0)(15)
            ddlUic.SelectedValue = myDataTable.Rows(0)(16)
            ddlAttachUic.SelectedValue = myDataTable.Rows(0)(17)
            ddlRace.SelectedValue = myDataTable.Rows(0)(18)
            ddlEthnic.SelectedValue = myDataTable.Rows(0)(19)
            ddlMos.SelectedValue = myDataTable.Rows(0)(20)
            txtPara.Text = myDataTable.Rows(0)(21)
            txtLine.Text = myDataTable.Rows(0)(22)
            ddlMeps.SelectedValue = myDataTable.Rows(0)(23)
            ddlLeadSource.SelectedValue = myDataTable.Rows(0)(24)
            ddlEducation.SelectedValue = myDataTable.Rows(0)(25)
            ddlYearsComplete.SelectedValue = myDataTable.Rows(0)(26)
            txtNotes.Text = myDataTable.Rows(0)(27)
            ddlEnlistment.SelectedValue = myDataTable.Rows(0)(28)
            ddlTrainOption.SelectedValue = myDataTable.Rows(0)(29)
            txtDtAvailTrain.Text = myDataTable.Rows(0)(30)
            txtTerm1.Text = myDataTable.Rows(0)(31).ToString.Substring(0, 1)
            txtTerm2.Text = myDataTable.Rows(0)(31).ToString.Substring(2, 1)
            txtBonus.Text = myDataTable.Rows(0)(32)
            txtBonusControl.Text = myDataTable.Rows(0)(33)
            txtKickerControl.Text = myDataTable.Rows(0)(34)
            txtSlrpControl.Text = myDataTable.Rows(0)(35)

            'Get the OtherOptions for the checkboxlist
            sql = "Select intotherOptId from RecruitOtherOptions where intRecruitId = " & RecruitId

            myDataTable = New DataTable
            myDataTable = getReader(sql)

            For Each row As DataRow In myDataTable.Rows
                For Each item As ListItem In cbOtherOptions.Items
                    If row(0) = item.Value Then
                        item.Selected = True
                    End If
                Next
            Next

            pnlAll.Style("display") = "inline"
        Else
            ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "NoData();", True)
        End If
    End Sub


'DOnt see how each other would affect the CSS styling on a page.
Can you post the rendered source?  If the CSS is in an external stylesheet it is possible that the path cannot be resolved.

Cd&
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for help