|
Yeah, I know. I was looking at loading them after startup. But then I have ordering issues. Removing them on load is a good idea. And I never noticed the conditional section in the project properties. Thanks.
|
|
|
|
|
Hi,
you dont need to include #define statements at all, you can define symbols in the
project properties dialog, under Build/General/Conditional Compilation Symbols.
That is what I do when I run two different projects (one .NET 1.1, one .NET 2.0)
on the same source files, to make sure my code works for both; doing so I can compensate
for slight differences between both .NET versions (e.g. method name changes in Dns class).
So I suggest you use Designer to set up your project in one way, then add #if #endif blocks
to modify it in your code files (e.g. after InitializeComponents) for the alternative way;
now change your defines manually in the property dialog; you could even add configurations
(say multiple debug configurations with different #defines).
|
|
|
|
|
Actually, I'm thinking about having different project files for each edition while keeping the same code. In this situation, it seems a more reasonable approach than moving shared functionality to a control library. Thanks for the suggestion.
|
|
|
|
|
Hi all
I want to access variables declared in the global asax page to a asmx page.
I declared variables as static public and then in asmx page i accessed it as
global.variable name..but i am not getting value assinged to it..Can any one give me a idea why its not getting values in the variable
Advance in thanks
Regards
DilipRam
|
|
|
|
|
Probabaly need to see your code, but it is a really bad idea to use a static var in global.asax. If you have an application wide varible you should use the application object, it is just like session. It can be set in an event in the global.asax or anywhere else for that matter. If the var is supose to be user specific then you need to use the session object.
Ben
|
|
|
|
|
Hi
Thanks for the reply.Here is the part of my code.
XMLCacheComm = new XMLCacheComm();
In Application_Start of global asax page
Application["XMLCacheComm"] = XMLCacheComm;
and in constructor XMLSportsIn() of webservice written as
XMLCacheComm XMLCacheComm1 = Application["XMLCacheComm"] as XMLCacheComm;
and in a method of webservice,when i call
XMLCacheComm1.SendMessage()..here i am getting object reference not set to an instance of an object
Any idea
Regards
DilipRam
|
|
|
|
|
When you create it in the application_start you have to assign it a variable
XMLCacheComm _xmlCacheComm= new XMLCacheComm();
In Application_Start of global asax page
Application["XMLCacheComm"] = _xmlCacheComm;
This line:
XMLCacheComm XMLCacheComm1 = Application["XMLCacheComm"] as XMLCacheComm;
You might want to double check to see if the item is there. Something like:
if (Application["XMLCacheComm"] != null)
{
XMLCacheComm XMLCacheComm1 = Application["XMLCacheComm"] as XMLCacheComm;
}
else
{
XMLCacheComm _xmlCacheComm= new XMLCacheComm();
Application["XMLCacheComm"] = _xmlCacheComm;
}
Hope that helps.
Ben
|
|
|
|
|
Hi Thanks for the reply.I got out the object error.but i am not getting values inside it..inside the global i will get the count as 2 but inside webservice its count is getting as 1...why is this happening
Regards
DilipRam T
|
|
|
|
|
I am not that familar with the XMLCacheComm object, so I am not sure what the Count property refers to. So I am not sure why the count would be 1 or 2.
Ben
|
|
|
|
|
Thanks Ben.I was assigning application variable at the initialization part.when i assigned it in section where i want actually, i am getting the value.Any way thanks for your replies.
Expecting a positive replies in future
Thanks
Regards
DilipRam
|
|
|
|
|
Hi,
I have a web page C#, written and working.
I now need to see and validate certain controls on my page beginning with 'dt'.
In VS2005 i can happily type ...
foreach (Control ctrl in MyPage.Controls ) and it would list them and then I can use them
This doesn't work in VS2003. Any suggestions welcome?
|
|
|
|
|
My guess would be that you don't have a page called MyPage in VS2003.
Ben
|
|
|
|
|
kubben wrote: My guess would be that you don't have a page called MyPage in VS2003
|
|
|
|
|
If this was meant to be helpful, you are an idiot.
I've got it now though......
foreach (Control c in Page.FindControl("MyPage").Controls)
Cheers
|
|
|
|
|
Sorry I offended you. I guess I should leave being funny up to others. I just thought something looked wrong with the MyPage.Controls. Glad you figured it out.
Ben
|
|
|
|
|
Hello Everyone,
Does c# uses it's own predefined keywords for input and output if yes plz let me know
Thnx in advance
|
|
|
|
|
The Knowledge wrote: Does c# uses it's own predefined keywords for input and output if yes plz let me know
Input/output to/from where?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
no, the C# (or C or C++ or Java) language does not have special keywords for input/
output. They rely on classes to do your I/O. See for instance SerialPort, Graphics,
File (and all the stream stuff) etc.
|
|
|
|
|
Luc Pattyn wrote: They rely on classes to do your I/O. See for instance SerialPort, Graphics,
File (and all the stream stuff) etc.
Aahh..... Was that what he meant?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Yes, I hope he was refering to such things as the good old IN and OUT statements in Basic
(and the corresponding assembly instructions available on several microprocessors).
|
|
|
|
|
Hi,
I'm writing an MDI application and want to change the default systemcolors assigned to my titlebars. Does anyone know of a way of doing this?
Thanks in advance!
Standards are great! Everybody should have one!
|
|
|
|
|
|
Thanks for the reply, but the article only provides a panel and a progressbar. Although they're really nice, what I'm looking for is to change the colors in the title bar of my child windows: In Window's classic theme they're set to the colors defined in the selected theme (blue and lightblue by default).
Standards are great! Everybody should have one!
|
|
|
|
|
Hi everybody,
I Had used the below code to adding the textbox contorl dynamically and nodes in the treeview but i have no idea to how to remove the created control by using the control name onbutton click and also i have to remove the corresponding nodes in the treeview.any suggestion?
int n = 25;
int m = 1;
private void BtnAddControl_Click(object sender, EventArgs e)
{
TextBox txtBox = new TextBox();
txtBox.Text = "TextBox" + m;
txtBox.TabIndex=m;
txtBox.Tag=m;
txtBox.Location = new System.Drawing.Point(10, n);
txtBox.Size = new System.Drawing.Size(70, 20);
txtBox.Name = "TextBox" + m;
txtBox.Click +=new EventHandler(txtBox_Click);
this.Controls.Add(txtBox);
TreeNode root = null;
if (TV.Nodes.Count == 0)
{
root = new TreeNode("TextBox");
root.Nodes.Add(txtBox.Name);
TV.Nodes.Add(root);
}
else
{
TV.Nodes[0].Nodes.Add(txtBox.Name);
}
TV.ExpandAll();
n = n + 20;
m++;
}
Regards
Kanna
|
|
|
|
|
Hello,
You have to iterate over the Controls Collection and compare the Name property
foreach(Control c in this.Controls)
{
if(c.Name.Equals("TextBox"+m.ToString()))
{
this.Controls.Remove(c);
break;
}
}
All the best,
Martin
|
|
|
|