Displaying music and image from file

// Put code into body of page


 <div id="wrapper" class=" mar1">
        <div id="wrapper_inner">
       <!-- Crumb Section -->
              <div id="crumb">
                <%--<a href="#">Home</a> <a class="active" href="#">Club Blog</a>--%>
            </div>
           <!-- Banner  --> 
            <div id="bannerinner">
               
                <asp:Image id="imgBanner" Width="920px" Height="115px" runat="server" ImageUrl="" ></asp:image>
            </div>
          <!--Content Sec -->
               <div id="content_sec">
            <!-- Inner Left Col -->
                <div class="leftcol">
                <div class="right-btn">
                 <asp:Button ID="btnBook" CssClass="artist"
                        ValidationGroup="send" BackColor="#FF00C6" Text="Book this Artist"
                                runat="server"  Visible="false"  onclick="btnBook_Click"  />
                </div>
                   <div class="left" > <h2 class="colr">
                        <asp:Label ID="lblTitle" runat="server"  ></asp:Label> </h2>

                       
                        </div>
                    <div class="blogsec">
                        <ul>
                            <li>
                                <h4>
                                    <asp:Label ID="lblSubtitle" runat="server"  ></asp:Label></h4>
                               
                                <div  style="width:100%; overflow:hidden;">
                                    <div class="postedb">
                                        <p class="posted">
                                            Posted by <asp:Label ID="lblPostedBy" Font-Bold="true" runat="server"  ></asp:Label>  on  <asp:Label ID="lblDate" runat="server"  ></asp:Label></p>
                                      
                                    </div>
                                    <p class="txt">
                                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                                        
                                    </p>
                                   
                                </div>
                                <div class="clear"></div>
                                <div runat="server" id="divMusic" visible="false">
                                <asp:Literal ID="LiteralMusic" runat="server"></asp:Literal>
                              

    
    </div>

       
  
                            </li>
                        </ul>
                    </div>
                <!-- Blog Reply -->
                    
                   <!--Paginaiton -->
                    
                </div>

             <!--Right Section-->
                <div class="rightcol">
                <!-- Search Blog-->
                        
                    <div class="box">
                        <h4 class="colr">
                           <asp:Label ID="LblRtop"  runat="server"  ></asp:Label></h4>
                        <ul>
                          
                            <asp:DataList ID="dtlRToplist" RepeatDirection="Vertical"
                    runat="server" 
                     >
                <ItemTemplate>
               
                <li> <a href='<%#"Posting.aspx?id="+ Eval("ListPosingId") %>'> <span>&nbsp;</span><asp:Label ID="lblPostedBy" Text='<%#Eval("title") %>' runat="server"  ></asp:Label></a></li>
                </ItemTemplate>
                </asp:DataList>
                        </ul>
                    </div>
                    <div id="divRbottom"  class="box" visible="false" runat="server" >
                        <h4 class="colr">
                            <asp:Label ID="LblRBottom" runat="server" Visible="false" ></asp:Label>
                        </h4>
                        <ul>
                            <asp:DataList ID="DtlRbottom"  RepeatDirection="Vertical"
                    runat="server"   Visible="false"
                     >
                <ItemTemplate>
               
                <li> <a href='<%#"Posting.aspx?id="+ Eval("ListPosingId") %>'> <span>&nbsp;</span><asp:Label ID="lblPostedBy" Text='<%#Eval("title") %>'  runat="server"  ></asp:Label></a></li>
                </ItemTemplate>
                </asp:DataList>
                        </ul>
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </div>


//Now write code in code behind



 protected void bindata()
    {
       
        lstDetail = context.fnSelectblogdetail(PostId).ToList();
        if (lstDetail[0].PostingType == "Artist")
        {
            btnBook.Visible = true;
            if (!string.IsNullOrEmpty(lstDetail[0].Artistmusic))
            {
                divMusic.Visible = true;
                string musicurl=Convert.ToString(lstDetail[0].Artistmusic);


                strbuild.Append("<object type='application/x-shockwave-flash'  id='dewplayer-vol' data='http://localhost:2471/keeton/dewplayer-vol.swf?mp3=http://localhost:2471/keeton/ArtistMusic/" + musicurl + "&autostart=1' height='30px' width='300px'  >");
                strbuild.Append("<param name='wmode'  value='transparent' /><param  name='movie' start='true' value='http://localhost:2471/keeton/dewplayer-vol.swf?mp3=http://localhost:2471/keeton/ArtistMusic/" + musicurl + "&autostart=1' /></object>");

                LiteralMusic.Text = strbuild.ToString();

            }

           
        }
        imgBanner.ImageUrl = "~/ListPostingImage/" + lstDetail[0].MainImage;
        lblTitle.Text = lstDetail[0].Title;
        lblDate.Text =lstDetail[0].Date.ToString("MMM dd yyyy");
        lblSubtitle.Text = lstDetail[0].Subtiltle;
        lblPostedBy.Text = lstDetail[0].PostedBy;

        Literal1.Text = Server.HtmlDecode(lstDetail[0].Body).Replace("../ListPostingImage/","/keeton/ListPostingImage/");

        //StringBuilder strb = new StringBuilder();
        //strb.Append(str);
        //strb.Append("<br /><h1> deepak</h1>");
        //Literal1.Text = strb.ToString();
              


    }

No comments:

Post a Comment