473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Repetition

Dear all,

I have a problem that I cannot understand the reason of.
My code is

private void ButtDetl_Click(object sender, System.EventArgs e)
{
// give an information of the sender
int num=this.GetNumber(((Button)sender).Name);
//check if there is a TextBox with same number of the sender after
"TextExpl"
foreach (Control c in this.Controls)
{
if (c.GetType().Name=="TextBox"&&c.Name=="TreeExpl"+n um.ToString())
// setup the DtBox
this.DtBox=(TextBox)c;
}
//insert Explanation Form if DtBox is not null
this.InsExplanation(DtBox);
}

Sometimes the line
this.InsExplanation(DtBox);
is done three or four times without a reason, inserting the same Explanation
Form (in my case) three or four times!!! Furthermore when I open my
application the Application_Load(object sender, System.EventArgs e) is
repeted 2 times.
Any suggestion?

Thank you,

Bart
Nov 16 '05 #1
2 1679
go to the HTML view of the form and check this line
<%@ Page language="c#" Codebehind="A.aspx.cs" AutoEventWireup="false"
Inherits="A.WebForm1" %>

AutoEventWireup is it set to true?
it should be set to false.

hope this helped,
Kannan.V

"Bart" wrote:
Dear all,

I have a problem that I cannot understand the reason of.
My code is

private void ButtDetl_Click(object sender, System.EventArgs e)
{
// give an information of the sender
int num=this.GetNumber(((Button)sender).Name);
//check if there is a TextBox with same number of the sender after
"TextExpl"
foreach (Control c in this.Controls)
{
if (c.GetType().Name=="TextBox"&&c.Name=="TreeExpl"+n um.ToString())
// setup the DtBox
this.DtBox=(TextBox)c;
}
//insert Explanation Form if DtBox is not null
this.InsExplanation(DtBox);
}

Sometimes the line
this.InsExplanation(DtBox);
is done three or four times without a reason, inserting the same Explanation
Form (in my case) three or four times!!! Furthermore when I open my
application the Application_Load(object sender, System.EventArgs e) is
repeted 2 times.
Any suggestion?

Thank you,

Bart

Nov 16 '05 #2

"Kannan.V [MCSD.net]" <Ka************@discussions.microsoft.com> wrote in
message news:B8**********************************@microsof t.com...
go to the HTML view of the form and check this line
<%@ Page language="c#" Codebehind="A.aspx.cs" AutoEventWireup="false"
Inherits="A.WebForm1" %>

AutoEventWireup is it set to true?
it should be set to false.
Actually I'm not using ASP.Net, just C# and Windows Form.....
I tried many methods, but always same problem...


hope this helped,
Kannan.V

"Bart" wrote:
Dear all,

I have a problem that I cannot understand the reason of.
My code is

private void ButtDetl_Click(object sender, System.EventArgs e)
{
// give an information of the sender
int num=this.GetNumber(((Button)sender).Name);
//check if there is a TextBox with same number of the sender after
"TextExpl"
foreach (Control c in this.Controls)
{
if (c.GetType().Name=="TextBox"&&c.Name=="TreeExpl"+n um.ToString()) // setup the DtBox
this.DtBox=(TextBox)c;
}
//insert Explanation Form if DtBox is not null
this.InsExplanation(DtBox);
}

Sometimes the line
this.InsExplanation(DtBox);
is done three or four times without a reason, inserting the same Explanation Form (in my case) three or four times!!! Furthermore when I open my
application the Application_Load(object sender, System.EventArgs e) is
repeted 2 times.
Any suggestion?

Thank you,

Bart

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Brad Kartchner | last post by:
In a project I am working on, I have found myself with two classes that reference each other. For example: firstclass.h: { class FirstClass { function (SecondClass* Pointer); } }
1
by: Chris Gamache | last post by:
For my particular case, word repetition shouldn't be relevant in determining the rank of a document. If I strip() the vector, I loose what relevance proximity and weight add to the rank. It seems...
2
by: Billy_270 | last post by:
Hi! I have a text "*.jpg;*.bmp;*.png" and I'd like to get "*.jpg", "*.bmp" and "*.png". I've tried the pattern "^(?:(\*\..+);)*(\*\..+)$", but it doen't work because it returns "*.jpg;*.bmp" and...
6
by: udhas | last post by:
Write a program that prints the following diamond shape. You may use output statements that print a single asterisk (*), a single space or a single carriage return. Maximize your use of repetition...
4
by: mj.clift | last post by:
Hi All, I need to be able to choose a random string from an array. That is easy enough, but I want to restrict the repetition of that string until one or two other choices have been made. So the...
4
by: XpatienceX | last post by:
Hi, Can someone help me with this assignment, I am confused of what is needed to be done here. I am suposed to design a program that models a worm's behavior in the following scenario: A...
5
by: NATHAN1511 | last post by:
How To Write A Program By Using Repetition Structure As Show Below: 1 12 123 1234 12345
15
by: Beany | last post by:
Hi All, i need help with the following: i need to write a simple program that asks the user to input a number (minimum of 3 digits), which i seperate into individual digits and print the 1st...
3
by: anizatie | last post by:
if i wanna do some programming lets say... i hv a=a+3*a*(1.0^-10) how to generate the answer if a=(1.0^-10) ive done but wen i compared the answer using calculator..the answer is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.