when i enter my aspx file first, i cant see record at gridview. ???

Last post 07-11-2009 1:21 PM by syedyaserahmed. 1 replies.

Sort Posts:

  • when i enter my aspx file first, i cant see record at gridview. ???

    07-11-2009, 6:21 AM
    • Member
      525 point Member
    • oguzkaygun
    • Member since 04-27-2008, 12:44 PM
    • Posts 1,261

     hello

    i have no problem while my website run my local computer. But i have problem at hosting. When i enter (load) my some website page, i cant see records at gridview. But when i click radiobuttonlist, i can see records at gridview. What can be problem ? how can i fix it ?

    My page load and click of radiobuttonlist are below.

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load'

    If Not Me.IsPostBack Then

    If User.Identity.IsAuthenticated = False Then

    Dim returnurl As String = "~/ilanlarim.aspx"

    Response.Redirect(String.Format("login.aspx?ReturnUrl=" & returnurl))

    Else

    UserIdL.Text = User.Identity.Name.ToString

     End If

    GridView1.Attributes.Add("style", "font-size:small;word-break:break-all;word-wrap:break-word")

    listele()

     End If

     End Sub

    Private Sub listele()

    ObjectDataSource1.SelectParameters.Clear()

    ObjectDataSource1.SelectParameters.Add("UserId", TypeCode.[String], UserIdL.Text)

    ObjectDataSource1.SelectParameters(0).Direction = ParameterDirection.Input

    If ilanturuL.Text = "Tm ˜lanlar" Then

    ObjectDataSource1.SelectParameters.Add("ilanturu", TypeCode.[String], "")

    Else

    ObjectDataSource1.SelectParameters.Add("ilanturu", TypeCode.[String], ilanturuL.Text)

    End If

    ObjectDataSource1.SelectParameters(1).Direction = ParameterDirection.Input

    ObjectDataSource1.SelectParameters.Add("aktifilan", TypeCode.[String], "True")

    ObjectDataSource1.SelectParameters(2).Direction = ParameterDirection.Input

     End Sub

     

     

     

    Protected Sub RadioButtonList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButtonList2.SelectedIndexChanged

    If RadioButtonList2.Items(0).Selected = True Then

    ilanturuL.Text ="Tm ˜lanlar"

    listele()

     End If

     If RadioButtonList2.Items(1).Selected = True Then

    ilanturuL.Text = "SatŸ ˜lanlar"

    listele()

     End If

     If RadioButtonList2.Items(2).Selected = True Then

    ilanturuL.Text = "Aranyor ˜lanlar"

    listele()

     End If

    If RadioButtonList2.Items(3).Selected = True Then

    ilanturuL.Text = "Ma§aza ˜lanlar"

    listele()

     End If

     End Sub

    Mark as me if my question or my answer can be helpful for you :)
  • Re: when i enter my aspx file first, i cant see record at gridview. ???

    07-11-2009, 1:21 PM
    Answer

     use the databind method the load the grid after adding new records, your grid is not loading after ur adding records, when you are clicking the radio buttons your page is posting back and again loading that is the reason u r seeing the records,

    gridview.Databind()

    this will solve your problem

Page 1 of 1 (2 items)