Infolink

 

Search This Blog

Showing posts with label Add Meta Description. Show all posts
Showing posts with label Add Meta Description. Show all posts

Jul 9, 2015

Make custom calendar in c#

calendar.aspx.cs

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            createcalendar(DateTime.Now.Month.ToString(), DateTime.Now.Year);
        }
    }

    public void createcalendar(string mt, int yr)
    {
        DataTable dtSource = new DataTable();
        dtSource.Columns.Add("Sunday");
        dtSource.Columns.Add("Monday");
        dtSource.Columns.Add("Tuesday");
        dtSource.Columns.Add("Wednesday");
        dtSource.Columns.Add("Thursday");
        dtSource.Columns.Add("Friday");
        dtSource.Columns.Add("Saturday");

        int year = yr;

        int month = Convert.ToInt16(mt);
        for (int y = 1; y <= 12; y++)
        {
            ddlmonth.Items.Add(new ListItem(y.ToString(), y.ToString()));
        }
        ddlmonth.SelectedValue = month.ToString();
        lblyear.Text = Convert.ToString(year);
        int DaysInMonth = DateTime.DaysInMonth(year, month);

        int i = 1;


        for (int weak = 0; weak <= 5; weak++)
        {
            DataRow newday = dtSource.NewRow();
            for (int day = 1; day <= 7; day++)
            {
                if (i > DaysInMonth) break;
                DateTime dDate = DateTime.ParseExact(i.ToString() + "/" + month.ToString() + "/" + year.ToString(), "d/M/yyyy", null);
                DayOfWeek dayWeek = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(dDate);
                newday[dayWeek.ToString()] = i.ToString();
                i++;

                if (dayWeek.ToString() == "Saturday") break;
            }
            dtSource.Rows.Add(newday);
            if (i > DaysInMonth) break;
        }

        WeekRepeater.DataSource = dtSource;
        WeekRepeater.DataBind();

        hdnyear.Value = year.ToString();


    }
    protected void lnkprev_Click(object sender, EventArgs e)
    {
        createcalendar(ddlmonth.SelectedValue, Convert.ToInt16(hdnyear.Value) - 1);
    }
    protected void lnknext_Click(object sender, EventArgs e)
    {
        createcalendar(ddlmonth.SelectedValue, Convert.ToInt16(hdnyear.Value) + 1);
    }
    protected void ddlmonth_SelectedIndexChanged(object sender, EventArgs e)
    {
        createcalendar(ddlmonth.SelectedValue, Convert.ToInt16(hdnyear.Value));
    }
    protected void btnshow_Click(object sender, EventArgs e)
    {
        createcalendar(ddlmonth.SelectedValue, Convert.ToInt16(hdnyear.Value));
    }

calendar.aspx


<div id="calbg">
    <div id="calcontent">
        <table>
            <tr>
                <td>
                    <asp:TextBox runat="server" ID="txtdatefrom"></asp:TextBox>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtdateto"></asp:TextBox>
                </td>
                <td>
                    <asp:Button runat="server" ID="btnshow" Text="SHOW" OnClick="btnshow_Click" />
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <asp:LinkButton runat="server" ID="lnkprev" Text="<" OnClick="lnkprev_Click"></asp:LinkButton>
                </td>
                <td colspan="5">
                    <asp:DropDownList runat="server" ID="ddlmonth" OnSelectedIndexChanged="ddlmonth_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                    <asp:Label runat="server" ID="lblyear"></asp:Label>
                </td>
                <td>
                    <asp:LinkButton runat="server" ID="lnknext" Text=">" OnClick="lnknext_Click"></asp:LinkButton>
                </td>
            </tr>
        </table>
        <asp:Repeater ID="WeekRepeater" runat="server" OnItemDataBound="WeekRepeater_ItemDataBound">
            <HeaderTemplate>
                <table>

                    <tr>
                        <th>Su
                        </th>
                        <th>Mo
                        </th>
                        <th>Tu
                        </th>
                        <th>Wed
                        </th>
                        <th>Thu
                        </th>
                        <th>Fr
                        </th>
                        <th>Sa
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label1" Text='<%# Eval("Sunday") %>' />
                    </td>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label2" Text='<%# Eval("Monday") %>' />
                    </td>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label3" Text='<%# Eval("Tuesday") %>' />
                    </td>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label4" Text='<%# Eval("Wednesday") %>' />
                    </td>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label5" Text='<%# Eval("Thursday") %>' />
                    </td>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label6" Text='<%# Eval("Friday") %>' />
                    </td>
                    <td bgcolor="#CCFFCC">
                        <asp:Label runat="server" ID="Label7" Text='<%# Eval("Saturday") %>' />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <asp:HiddenField runat="server" ID="hdnyear" />
    </div>
</div>

Dec 19, 2012

How to Add Meta Description and Keywords to Blogger:

How to Add Meta Description and Keywords to Blogger:
  •     Login to your blogger blog
  •     Goto Design and after that Edit Html
  •     Add the following code
<meta content=’your description here’ name=’description’/>

<meta content=’your keywords here’ name=’keywords’/>


Click Save Template. Now you added meta tags to your blogger blog. The description and keywords will be showed on every posts.

How to Add Unique Meta Description and Keywords to Blogger:

Just Change the code like this :-
Add Meta Description:

<meta expr:content=’data:blog.pageName + data:blog.title + data:blog.pageName’ name=’Description’/>

The above code will add your Blog post’s title and Blog title as your Meta description of blog posts.
Add Meta Keywords:

<meta expr:content=’data:blog.pageName + data:blog.title + data:blog.pageName’ name=’Keywords’/>

The above code will add your Blog post’s title and Blog title as your post’s Meta Keywords.

The unique meta description / keywords / tags for blogger blog should improve your blog post’s search engine rankings. But, keep in mind don’t add many title tag in your meta description. Because, this may be  irritate your post.
Related Posts Plugin for WordPress, Blogger...