How to use if else inside the Repeater control using C#?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:DataList ID="DataList1" runat="server">
        </asp:DataList>
   
    </div>
    <asp:Repeater ID="Repeater1" runat="server"
        onitemcommand="Repeater1_ItemCommand">
    <ItemTemplate>
        <asp:LinkButton ID="LinkButton1" CommandName="cmd" runat="server" Text='<%#Eval("name") %>'>LinkButton</asp:LinkButton>
    </ItemTemplate>
    </asp:Repeater>
    </form>
</body>
</html>
..............................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(@"server=COMTECH-PC\SQLEXPRESS;database=ShriGaneshayNamah;integrated security=true;");
    protected void Page_Load(object sender, EventArgs e)
    {
        string str = "select * from employee";
        SqlDataAdapter da = new SqlDataAdapter(str,con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        Repeater1.DataSource = ds;
        Repeater1.DataBind();
    }
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if(e.CommandName=="cmd")
        {
            LinkButton lnk = (LinkButton)e.Item.FindControl("LinkButton1");
            string name = lnk.Text;
            if(name=="kul")
            {
                Response.Redirect("https://www.google.co.in/?gfe_rd=cr&ei=vlqFVr78G6fR8AfnlJ_wAQ&gws_rd=ssl");
            }
            else if(name=="raj")
            {
                Response.Redirect("https://www.facebook.com/");
            }
        }
    }
}
Share:

How to create Repeater paging in Asp.net using C#?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using System.Globalization;

public partial class ifrmenquire_kappl_awards : System.Web.UI.Page
{
    int totalCount = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
         
        }

        try
        {
            DataSet ds = new DataSet();
            String sql = "sp_get_award";

            SqlDataAdapter adapter = new SqlDataAdapter(sql, Util.GetSourceWebsite());
            adapter.Fill(ds);
            totalCount = ds.Tables[0].Rows.Count;
            bindData();
       
        }
        catch(Exception ex)
        {
        }
     
    }
    public void bindData()
    {
        try
        {
            DataSet ds = new DataSet();
            String sql = "sp_get_award";
            int val = Convert.ToInt16(txtHidden.Value);
            if (val <= 0)
                val = 0;

            SqlDataAdapter adapter = new SqlDataAdapter(sql, Util.GetSourceWebsite());
            adapter.Fill(ds, val, 9, "blogs_Posts");
            rptritems.DataSource = ds;
            rptritems.DataBind();

            if (val <= 0)
            {
                lnkBtnPrev.Visible = false;
                lnkBtnNext.Visible = true;
            }

            if (val >= 3)
            {
                lnkBtnPrev.Visible = true;
                lnkBtnNext.Visible = true;
            }

            if ((val + 3) >= totalCount)
            {
                lnkBtnNext.Visible = false;
            }
        }
        catch(Exception ex)
        {
        }
    }
    protected void lnkBtnPrev_Click(object sender, EventArgs e)
    {
        try
        {
            txtHidden.Value = Convert.ToString(Convert.ToInt16(txtHidden.Value) - 6);
            bindData();
        }
        catch (Exception ex)
        {
        }
    }
    protected void lnkBtnNext_Click(object sender, EventArgs e)
    {
        try
        {
            txtHidden.Value = Convert.ToString(Convert.ToInt16(txtHidden.Value) + 6);
            bindData();
        }
        catch(Exception ex)
        {
        }
     
    }
    private void LoadDataForAwards()
    {
        try
        {
            BlogsDAL dal = new BlogsDAL();
            DataTable dt = dal.LoadDataForAwardsPost(Util.GetSourceWebsite());
            rptritems.DataSource = dt;
            rptritems.DataBind();
        }
        catch(Exception ex)
        {
            throw;
        }
       
    }


    protected void rptritems_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try{
            if (e.CommandName == "cmd")
            {
                string str = "sp_get_award";
                SqlDataAdapter da = new SqlDataAdapter(str, Util.GetSourceWebsite());
                DataSet ds = new DataSet();
                da.Fill(ds);
                string name = ds.Tables[0].Rows[0]["Author"].ToString();
                if (name == "Abhilash")
                {
               
                    Response.Redirect("http://www.whyayurveda.org/author/abhilash-k.r.aspx");
                }
                else if (name == "Gita")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/gita-ramesh.aspx");
                }
                else if (name == "Abishek")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/abishek-k.r.aspx");
                }
                else if (name == "reeta-bhattacharjee")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/reeta-bhattacharjee.aspx");
                }
                else if (name == "ramesh")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/ramesh-k.v.aspx");
                }
            }
        }
        catch(Exception ex)
        {
        }
    }
    protected void rptritems_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataSet ds = new DataSet();
                String sql = "sp_get_award";
                DateTime date;
                SqlDataAdapter adapter = new SqlDataAdapter(sql, Util.GetSourceWebsite());
                adapter.Fill(ds);
                string getdate = ds.Tables[0].Rows[0]["post_AddedDate"].ToString();
               
                date = Convert.ToDateTime(getdate);

                Label lblAnswer = e.Item.FindControl("Label1") as Label;
                lblAnswer.Text = date.ToString("ddd d MMM yyyy", CultureInfo.CreateSpecificCulture("en-US"));

               
            }
        }
        catch(Exception ex)
        {
        }
    }
}
................................................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ifrmenquire_kappl_awards.aspx.cs" Inherits="ifrmenquire_kappl_awards" %>

<!DOCTYPE html>
<html lang="en-US">
<head runat="server">
    <title></title>
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/kappl-awards.css" />

    <script src="css/jQuery1.9.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server" class="pad10awd">
    <div id="divTop5" runat="server">
                </div>
    <div class="blogwhy">
        <ul class="whyayurveda">
            <asp:Repeater ID="rptritems" runat="server" 
                onitemcommand="rptritems_ItemCommand" onitemdatabound="rptritems_ItemDataBound" 
                >
                <ItemTemplate>
                    <li class="blog<%# DataBinder.Eval(Container.DataItem, "post_kid")%>">
                        <div class="whytitle">
                            <a onclick="blogshow( <%# DataBinder.Eval(Container.DataItem, "post_kid")%>);" class="posttitle">
                                <%# DataBinder.Eval(Container.DataItem, "post_title")%></a>
                        </div>
                        <div class="whydescription">
                            <div class="postsummary">
                                <%# DataBinder.Eval(Container.DataItem, "post_summary")%>
                            </div>
                            <div class="hidden postcontent">
                                <%# DataBinder.Eval(Container.DataItem, "post_title")%>
                            </div>
                            <div class="hidden mainurulwhy">
                                <%# DataBinder.Eval(Container.DataItem, "post_mainimagename")%>
                            </div>
                        </div>
                        <div class="whypic">
                            <a><span>
                                <img class="img1" src=" <%# DataBinder.Eval(Container.DataItem, "post_MainImageName")%>" />
                                <span class="viewdtl" onclick="blogshow( <%# DataBinder.Eval(Container.DataItem, "post_kid")%>);">
                                </span></a>
                        </div>
                        <div class="whyposted">
                            <p>
                                Posted By 
                                <a target="_blank" href="<%# DataBinder.Eval(Container.DataItem, "author")%>">
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="cmd" Text='<%# DataBinder.Eval(Container.DataItem, "author")%>'>LinkButton</asp:LinkButton>
                                    
                                    
                        <%-- <%# DataBinder.Eval(Container.DataItem, "author")%>--%>

                                  </a>
                                  posted on  
                                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                                  
<%--                                 <%#Eval("post_AddedDate", "{0:D}")%>
--%>                                at
                                <br />
                                <%#Eval("post_AddedDate", "{0:t}")%>
                            </p>
                        </div>
                        <div class="learnmore">
                            <a onclick="blogshow( <%# DataBinder.Eval(Container.DataItem, "post_kid")%>);">Learn
                                More</a>
                        </div>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
        <div class="paging">
            <input id="txtHidden" style="width: 28px" type="hidden" value="0" runat="server" /><hr>
            <asp:LinkButton ID="lnkBtnPrev" runat="server" Font-Underline="False" OnClick="lnkBtnPrev_Click"
                Font-Bold="True"><span class="prevpanel">← Prev</span></asp:LinkButton>
            &nbsp;&nbsp;
            <asp:LinkButton ID="lnkBtnNext" runat="server" Font-Underline="False" OnClick="lnkBtnNext_Click"
                Font-Bold="True"><span class="nextpanel">Next →</asp:LinkButton>
        </div>
    </div>
    <div class="blogwhyfull hideme">
        <div class="basecent">
            <div class="close-dtl">
                <a onclick="$('.blogwhyfull').hide();">x</a>
            </div>
            <ul class="whyayurvedapop">
                <li>
                    <div class="whytitle1 cnt">
                    </div>
                    <div class="whyposted1 cnt">
                    </div>
                    <div class="whydescription1 cnt sammary">
                    </div>
                    <div class="whypic1">
                        <img class="img2" alt="blog" />
                    </div>
                    <div class="whydescription1 cnt maindesc">
                    </div>
                    <p>
                        <strong>Courtesy:</strong> <a href="http://www.whyayurveda.org/products/2014/09/22/ayurveda-for-hair-diseases.aspx">Whyayurveda</a>
                    </p>
                    <div class="arrows-nex-prev pop">
                  


                    <a  href="http://www.kairaliproducts.in/enqurie-now"><span class="prevpanel">Enquire Now</span>
                    </a>
                    <a  href="http://www.kairaliproducts.in/online-consultation"><span class="nextpanel">
                            Free Online Consultation</span> </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    </form>

    <script language="javascript">
        function blogshow(id) {
            var options = {};
            $(".cnt").empty();
            $(".whytitle1").html($(".blog" + id).find('.posttitle').html());
            $(".sammary").html($(".blog" + id).find('.postsummary').html());
            $(".maindesc").html($(".blog" + id).find('.postcontent').html());
            $(".whyposted1").html($(".blog" + id).find('.whyposted').html());
            $(".img2").attr('src', $(".blog" + id).find('.img1').attr('src'));
            $("#alinkaway").attr('href', $(".blog" + id).find('.mainurulwhy').html());
            $(".blogwhyfull").show();
        }
        $(document).ready(function() {
            if (getParameterByName('id') > 0) {
                blogshow(getParameterByName('id'));
            }
        });
        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
            var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
            return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
        }
    </script>

</body>
</html>

Share:

Thursday, 31 December 2015

How to use if else inside the Repeater control using C#?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:DataList ID="DataList1" runat="server">
        </asp:DataList>
   
    </div>
    <asp:Repeater ID="Repeater1" runat="server"
        onitemcommand="Repeater1_ItemCommand">
    <ItemTemplate>
        <asp:LinkButton ID="LinkButton1" CommandName="cmd" runat="server" Text='<%#Eval("name") %>'>LinkButton</asp:LinkButton>
    </ItemTemplate>
    </asp:Repeater>
    </form>
</body>
</html>
..............................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(@"server=COMTECH-PC\SQLEXPRESS;database=ShriGaneshayNamah;integrated security=true;");
    protected void Page_Load(object sender, EventArgs e)
    {
        string str = "select * from employee";
        SqlDataAdapter da = new SqlDataAdapter(str,con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        Repeater1.DataSource = ds;
        Repeater1.DataBind();
    }
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if(e.CommandName=="cmd")
        {
            LinkButton lnk = (LinkButton)e.Item.FindControl("LinkButton1");
            string name = lnk.Text;
            if(name=="kul")
            {
                Response.Redirect("https://www.google.co.in/?gfe_rd=cr&ei=vlqFVr78G6fR8AfnlJ_wAQ&gws_rd=ssl");
            }
            else if(name=="raj")
            {
                Response.Redirect("https://www.facebook.com/");
            }
        }
    }
}

How to create Repeater paging in Asp.net using C#?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using System.Globalization;

public partial class ifrmenquire_kappl_awards : System.Web.UI.Page
{
    int totalCount = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
         
        }

        try
        {
            DataSet ds = new DataSet();
            String sql = "sp_get_award";

            SqlDataAdapter adapter = new SqlDataAdapter(sql, Util.GetSourceWebsite());
            adapter.Fill(ds);
            totalCount = ds.Tables[0].Rows.Count;
            bindData();
       
        }
        catch(Exception ex)
        {
        }
     
    }
    public void bindData()
    {
        try
        {
            DataSet ds = new DataSet();
            String sql = "sp_get_award";
            int val = Convert.ToInt16(txtHidden.Value);
            if (val <= 0)
                val = 0;

            SqlDataAdapter adapter = new SqlDataAdapter(sql, Util.GetSourceWebsite());
            adapter.Fill(ds, val, 9, "blogs_Posts");
            rptritems.DataSource = ds;
            rptritems.DataBind();

            if (val <= 0)
            {
                lnkBtnPrev.Visible = false;
                lnkBtnNext.Visible = true;
            }

            if (val >= 3)
            {
                lnkBtnPrev.Visible = true;
                lnkBtnNext.Visible = true;
            }

            if ((val + 3) >= totalCount)
            {
                lnkBtnNext.Visible = false;
            }
        }
        catch(Exception ex)
        {
        }
    }
    protected void lnkBtnPrev_Click(object sender, EventArgs e)
    {
        try
        {
            txtHidden.Value = Convert.ToString(Convert.ToInt16(txtHidden.Value) - 6);
            bindData();
        }
        catch (Exception ex)
        {
        }
    }
    protected void lnkBtnNext_Click(object sender, EventArgs e)
    {
        try
        {
            txtHidden.Value = Convert.ToString(Convert.ToInt16(txtHidden.Value) + 6);
            bindData();
        }
        catch(Exception ex)
        {
        }
     
    }
    private void LoadDataForAwards()
    {
        try
        {
            BlogsDAL dal = new BlogsDAL();
            DataTable dt = dal.LoadDataForAwardsPost(Util.GetSourceWebsite());
            rptritems.DataSource = dt;
            rptritems.DataBind();
        }
        catch(Exception ex)
        {
            throw;
        }
       
    }


    protected void rptritems_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try{
            if (e.CommandName == "cmd")
            {
                string str = "sp_get_award";
                SqlDataAdapter da = new SqlDataAdapter(str, Util.GetSourceWebsite());
                DataSet ds = new DataSet();
                da.Fill(ds);
                string name = ds.Tables[0].Rows[0]["Author"].ToString();
                if (name == "Abhilash")
                {
               
                    Response.Redirect("http://www.whyayurveda.org/author/abhilash-k.r.aspx");
                }
                else if (name == "Gita")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/gita-ramesh.aspx");
                }
                else if (name == "Abishek")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/abishek-k.r.aspx");
                }
                else if (name == "reeta-bhattacharjee")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/reeta-bhattacharjee.aspx");
                }
                else if (name == "ramesh")
                {
                    Response.Redirect("http://www.whyayurveda.org/author/ramesh-k.v.aspx");
                }
            }
        }
        catch(Exception ex)
        {
        }
    }
    protected void rptritems_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataSet ds = new DataSet();
                String sql = "sp_get_award";
                DateTime date;
                SqlDataAdapter adapter = new SqlDataAdapter(sql, Util.GetSourceWebsite());
                adapter.Fill(ds);
                string getdate = ds.Tables[0].Rows[0]["post_AddedDate"].ToString();
               
                date = Convert.ToDateTime(getdate);

                Label lblAnswer = e.Item.FindControl("Label1") as Label;
                lblAnswer.Text = date.ToString("ddd d MMM yyyy", CultureInfo.CreateSpecificCulture("en-US"));

               
            }
        }
        catch(Exception ex)
        {
        }
    }
}
................................................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ifrmenquire_kappl_awards.aspx.cs" Inherits="ifrmenquire_kappl_awards" %>

<!DOCTYPE html>
<html lang="en-US">
<head runat="server">
    <title></title>
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/kappl-awards.css" />

    <script src="css/jQuery1.9.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server" class="pad10awd">
    <div id="divTop5" runat="server">
                </div>
    <div class="blogwhy">
        <ul class="whyayurveda">
            <asp:Repeater ID="rptritems" runat="server" 
                onitemcommand="rptritems_ItemCommand" onitemdatabound="rptritems_ItemDataBound" 
                >
                <ItemTemplate>
                    <li class="blog<%# DataBinder.Eval(Container.DataItem, "post_kid")%>">
                        <div class="whytitle">
                            <a onclick="blogshow( <%# DataBinder.Eval(Container.DataItem, "post_kid")%>);" class="posttitle">
                                <%# DataBinder.Eval(Container.DataItem, "post_title")%></a>
                        </div>
                        <div class="whydescription">
                            <div class="postsummary">
                                <%# DataBinder.Eval(Container.DataItem, "post_summary")%>
                            </div>
                            <div class="hidden postcontent">
                                <%# DataBinder.Eval(Container.DataItem, "post_title")%>
                            </div>
                            <div class="hidden mainurulwhy">
                                <%# DataBinder.Eval(Container.DataItem, "post_mainimagename")%>
                            </div>
                        </div>
                        <div class="whypic">
                            <a><span>
                                <img class="img1" src=" <%# DataBinder.Eval(Container.DataItem, "post_MainImageName")%>" />
                                <span class="viewdtl" onclick="blogshow( <%# DataBinder.Eval(Container.DataItem, "post_kid")%>);">
                                </span></a>
                        </div>
                        <div class="whyposted">
                            <p>
                                Posted By 
                                <a target="_blank" href="<%# DataBinder.Eval(Container.DataItem, "author")%>">
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="cmd" Text='<%# DataBinder.Eval(Container.DataItem, "author")%>'>LinkButton</asp:LinkButton>
                                    
                                    
                        <%-- <%# DataBinder.Eval(Container.DataItem, "author")%>--%>

                                  </a>
                                  posted on  
                                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                                  
<%--                                 <%#Eval("post_AddedDate", "{0:D}")%>
--%>                                at
                                <br />
                                <%#Eval("post_AddedDate", "{0:t}")%>
                            </p>
                        </div>
                        <div class="learnmore">
                            <a onclick="blogshow( <%# DataBinder.Eval(Container.DataItem, "post_kid")%>);">Learn
                                More</a>
                        </div>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
        <div class="paging">
            <input id="txtHidden" style="width: 28px" type="hidden" value="0" runat="server" /><hr>
            <asp:LinkButton ID="lnkBtnPrev" runat="server" Font-Underline="False" OnClick="lnkBtnPrev_Click"
                Font-Bold="True"><span class="prevpanel">← Prev</span></asp:LinkButton>
            &nbsp;&nbsp;
            <asp:LinkButton ID="lnkBtnNext" runat="server" Font-Underline="False" OnClick="lnkBtnNext_Click"
                Font-Bold="True"><span class="nextpanel">Next →</asp:LinkButton>
        </div>
    </div>
    <div class="blogwhyfull hideme">
        <div class="basecent">
            <div class="close-dtl">
                <a onclick="$('.blogwhyfull').hide();">x</a>
            </div>
            <ul class="whyayurvedapop">
                <li>
                    <div class="whytitle1 cnt">
                    </div>
                    <div class="whyposted1 cnt">
                    </div>
                    <div class="whydescription1 cnt sammary">
                    </div>
                    <div class="whypic1">
                        <img class="img2" alt="blog" />
                    </div>
                    <div class="whydescription1 cnt maindesc">
                    </div>
                    <p>
                        <strong>Courtesy:</strong> <a href="http://www.whyayurveda.org/products/2014/09/22/ayurveda-for-hair-diseases.aspx">Whyayurveda</a>
                    </p>
                    <div class="arrows-nex-prev pop">
                  


                    <a  href="http://www.kairaliproducts.in/enqurie-now"><span class="prevpanel">Enquire Now</span>
                    </a>
                    <a  href="http://www.kairaliproducts.in/online-consultation"><span class="nextpanel">
                            Free Online Consultation</span> </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    </form>

    <script language="javascript">
        function blogshow(id) {
            var options = {};
            $(".cnt").empty();
            $(".whytitle1").html($(".blog" + id).find('.posttitle').html());
            $(".sammary").html($(".blog" + id).find('.postsummary').html());
            $(".maindesc").html($(".blog" + id).find('.postcontent').html());
            $(".whyposted1").html($(".blog" + id).find('.whyposted').html());
            $(".img2").attr('src', $(".blog" + id).find('.img1').attr('src'));
            $("#alinkaway").attr('href', $(".blog" + id).find('.mainurulwhy').html());
            $(".blogwhyfull").show();
        }
        $(document).ready(function() {
            if (getParameterByName('id') > 0) {
                blogshow(getParameterByName('id'));
            }
        });
        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
            var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
            return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
        }
    </script>

</body>
</html>

Popular

Total Pageviews

Archive