Wednesday, January 12, 2011

Add and Remove Web User Control Dynamically

webuser control ascx page :

AddTier.ascx
TextBox-> asp:TextBox runat="server" ID="txt"


page for dynamically add this control :

TestConrol.aspx

Button -> asp:Button runat="server" ID="btnSaleTier" Text="Add Tier" OnClick="btnSaleTier_Click"
Button -> asp:Button runat="server" ID="btnSaleRemove" Text="Remove Last Tier" OnClick="btnSaleRemove_Click"

Panel : asp:Panel runat="server" ID="pnlAddSaleTier"



TestControl.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{

int num = 0;
if (ViewState["Counter"] != null)
{
num = (int)ViewState["Counter"];
}
else
{
ViewState["Counter"] = 0;
}
for (int j = 0; j < num; j++)
{
Control cl = LoadControl("~/AddTier.ascx");

cl.ID = "c" + j;
if (pnlAddSaleTier.FindControl(cl.ID) != null)
{

}
else
{
pnlAddSaleTier.Controls.Add(cl);
}
}
if (ViewState["Remove"] == "1")
{
pnlAddSaleTier.Controls.RemoveAt(Convert.ToInt32(ViewState["Counter"]));
}

}

protected void btnSaleTier_Click(object sender, EventArgs e)
{
ViewState["Counter"] = (int)ViewState["Counter"] + 1;
Page_Load(Page, new EventArgs());
}

protected void btnSaleRemove_Click(object sender, EventArgs e)
{

ViewState["Remove"] = "1";
Page_Load(Page, new EventArgs());
ViewState["Remove"] = "0";
ViewState["Counter"] = (int)ViewState["Counter"] - 1;
}

Monday, August 16, 2010

The Power of Positive Thinking

You are what you think. You think what you want.

All of our feelings, beliefs and knowledge are based on our internal thoughts, both conscious and subconscious. We are in control, whether we know it or not.

We can be positive or negative, enthusiastic or dull, active or passive.The biggest difference between people is their attitudes. For some, learning is enjoyable and exciting. For others, learning is a drudgery. For many, learning is just okay, something required on the road to a job.

“Most folks are about as happy as they make up their minds to be.”
Abraham Lincoln

Our present attitudes are habits, built from the feedback of parents, friends, society and self, that form our self-image and our world-image. These attitudes are maintained by the inner conversations we constantly have with ourselves, both consciously and subconsciously.

The first step in changing our attitudes is to change our inner conversations. Then what Should We Be Saying?

One approach is called the three C's: Commitment, Control and Challenge.

Commitment
Make a positive commitment to yourself, to learning, work, family, friends, nature, and other worthwhile causes. Praise yourself and others. Dream of success. Be enthusiastic.

Control
Keep your mind focused on important things. Set goals and priorities for what you think and do. Visualize to practice your actions. Develop a strategy for dealing with problems. Learn to relax. Enjoy successes. Be honest with yourself.

Challenge
Be courageous. Change and improve each day. Do your best and don't look back. See learning and change as opportunities. Try new things. Consider several options. Meet new people. Ask lots of questions. Keep track of your mental and physical health. Be optimistic.

Studies show that people with these characteristics are winners in good times and survivors in hard times.

Research shows that,
“… people who begin consciously to modify their inner conversations and assumptions report an almost immediate improvement in their performance. Their energy increases and things seem to go better …”

5 Suggestions for Building Positive Attitudes

In professional life, look for positive people to associate with.
At every discussion, look for one more interesting idea.
In every friend, try to find the best thing in her/him, the most attractive and interesting.
With yourself, keep a list of your goals, positive thoughts and actions.
Remember, you are what you think, you think what you want.

BETTAR Nadia

Thursday, June 17, 2010

Great Saying



"
It takes a minute to have a crush on someone, an hour to like someone, and a day to love someone... but it takes a lifetime to forget someone."

"People are always change with time"

"Life is Nothing without Money"