Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How can i bind DetailsView

How can i bind DetailsView

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-net
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mghiassi
    wrote on last edited by
    #1

    Hi all, I use DetailsView Object in ASP.NET. It dosen’t appear until the refresh button in IE clicks. I set the DataSource Property and use the DataBind Method. What i can do?

    N 1 Reply Last reply
    0
    • M mghiassi

      Hi all, I use DetailsView Object in ASP.NET. It dosen’t appear until the refresh button in IE clicks. I set the DataSource Property and use the DataBind Method. What i can do?

      N Offline
      N Offline
      Naveed Kamboh
      wrote on last edited by
      #2

      would you like to post your code with the event you are using to perform tis task?

      Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam

      M 1 Reply Last reply
      0
      • N Naveed Kamboh

        would you like to post your code with the event you are using to perform tis task?

        Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam

        M Offline
        M Offline
        mghiassi
        wrote on last edited by
        #3

        Hi This is my code asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Height="40px"Style="direction: rtl" Width="472px" Fields asp:BoundField DataField="Employer" HeaderText="کارفرما" asp:BoundField DataField="Advisor" HeaderText="مشاور" asp:BoundField DataField="StartTime" HeaderText="زمان شروع" asp:BoundField DataField="EndTime" HeaderText="پیش بینی تاریخ اتمام پروژه" asp:BoundField DataField="TimeAgreement" HeaderText="مدت قرارداد به ماه" asp:BoundField DataField="State" HeaderText="محل اجرا" Fields asp:DetailsView> asp:SqlDataSource ID="SQLDS_ALLV_TitleIE" runat="server" ConnectionString="<%$ ConnectionStrings:SamanMohitConnectionString %>" SelectCommand="ALLV_TitleIE" SelectCommandType="StoredProcedure" SelectParameters asp:ControlParameter ControlID="Label1" Name="F_Title" PropertyName="Text" Type="String" asp:Parameter DefaultValue="فارسی" Name="F_Language" Type="String" SelectParameters asp:SqlDataSource I use the "<"and "/>" in my code And this is runtime code Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (Application("SN") = "Agreement") Then Label1.Text = PreviousPage.mText1.Text DetailsView1.DataSource = SQLDS_ALLV_TitleIE DetailsView1.DataBind() ElseIf (Application("SN") = "News") Then Label3.Text = PreviousPage.mText1.Text DetailsView2.DataSource = SQLDS_NL_Title DetailsView2.DataBind() End If LinkButton1.CommandName = Application("Search") End Sub -- modified at 0:48 Sunday 8th April, 2007

        A 1 Reply Last reply
        0
        • M mghiassi

          Hi This is my code asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Height="40px"Style="direction: rtl" Width="472px" Fields asp:BoundField DataField="Employer" HeaderText="کارفرما" asp:BoundField DataField="Advisor" HeaderText="مشاور" asp:BoundField DataField="StartTime" HeaderText="زمان شروع" asp:BoundField DataField="EndTime" HeaderText="پیش بینی تاریخ اتمام پروژه" asp:BoundField DataField="TimeAgreement" HeaderText="مدت قرارداد به ماه" asp:BoundField DataField="State" HeaderText="محل اجرا" Fields asp:DetailsView> asp:SqlDataSource ID="SQLDS_ALLV_TitleIE" runat="server" ConnectionString="<%$ ConnectionStrings:SamanMohitConnectionString %>" SelectCommand="ALLV_TitleIE" SelectCommandType="StoredProcedure" SelectParameters asp:ControlParameter ControlID="Label1" Name="F_Title" PropertyName="Text" Type="String" asp:Parameter DefaultValue="فارسی" Name="F_Language" Type="String" SelectParameters asp:SqlDataSource I use the "<"and "/>" in my code And this is runtime code Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (Application("SN") = "Agreement") Then Label1.Text = PreviousPage.mText1.Text DetailsView1.DataSource = SQLDS_ALLV_TitleIE DetailsView1.DataBind() ElseIf (Application("SN") = "News") Then Label3.Text = PreviousPage.mText1.Text DetailsView2.DataSource = SQLDS_NL_Title DetailsView2.DataBind() End If LinkButton1.CommandName = Application("Search") End Sub -- modified at 0:48 Sunday 8th April, 2007

          A Offline
          A Offline
          Abolfazl Sheikhloo
          wrote on last edited by
          #4

          سلام اگر فارسی می نویسیم به این دلیل است که از نوع عناوین جنابعالی فهمیدم که ایرانی هستید. به هر حال برای Bind کردن DetailsView با این روشی که شما انتخاب کرده اید و از SqlDataSource استفاده می کنید، برای گرفتن نتیجه باید از DetailsView1.DataSourceId استفاده کنید درضمن هنگام تعریف DetailsView میتوانید در کد های HTML نیز این مشخصه را تعیین نمایید برای مثال: asp:DetailsView ID="dtl1" DataSourceId="SQLDS_ALLV_TitleIE" runat="server" ..... /asp:DetailsView در ضمن بهتر است دستور Select شما حاوی شرطی باشد که موجب برگرداندن یک رکورد شود. اگر هم با SqlDataSource مشکل دارید می توانید از DataTable استفاده کنید. ال

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups