|
I have created an enumeration in the class named abc.cs and placed that in the App_Code directory
<br />
public enum MyEnum<br />
{<br />
alfa = 1,<br />
beta = 2,<br />
gamma = 3<br />
};<br />
I have to access this and display in the list control of a webform .
can anyone help me with the corresponding syntax.
i will be thankful to you.
Sebastian
|
|
|
|
|
You should place it within a namespace:
namespace MyProject.MyEnums
{
public enum MyEnum
{
alfa = 1,
beta = 2,
gamma = 3
};
}
then, you should be able to access it anywhere. To get it's value in your aspx, you need a code block:
<%# MyProject.MyEnums.MyEnum.alfa %>
for example.
In your code behind you can put a using statement for the namespace, or access the enum by the full name.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Thank you very much. Everytime you are there to help me.
In this scenario i have to know all the members of the enum. but if i use a file to store the values the updations will reflect in the webpage automatically. is n't it?
is there any better alternatives?
Thanks once again
sebastian
|
|
|
|
|
Im very new in c#, how do i create an application form with labels and text boxes, listbox, submit and clear in either windows forms or console
csanda
|
|
|
|
|
You are definately new. A console app doesn't have labels or text boxes. In fact, doing this is trival, and doesn't even require code. However, before doing this, you should work through a book that teaches C#, and learn the language, on the console. Either way, your question can't be answered in a forum post, you need to buy some sort of C# book and work through it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi,
Is there a quick and simple way to get a UML diagram of your classes using Visual C# express? (2k5)
|
|
|
|
|
|
I am not sure in 2k5 but in 2k3 Go to: Project-> Visio UML-> Reverse Engeinner.
I think it may help you
Evil Inside
|
|
|
|
|
Hi,
I wish to set a registry value to record where my programs database was installed.
This folder will change depending on whether it is installed for "Only Me" or "All users".
I know about the [AppDataFolder] and the [CommonAppDataFolder] and can use them but how do i determine which one is to be used so that I can create the relative registry entry?
I tried setting a condition for both/either of them ie ALLUSERS=0 or ALLUSERS=1 but that only results in neither of the registry entries being created.
Thanks,
Glen Harvy
|
|
|
|
|
I'm a Fresher,
I don't know how to create virtual directory... Can anyone explain me how to create?
|
|
|
|
|
Virtual directory in what?
|
|
|
|
|
Hi
Check this step by step article
How to Create Virtual directory[^]
Dont know where to start. Just Click start -> Run. Type 'inetmgr' and you will list of websites.
Check the link given above and create virtual directory.
Harini
|
|
|
|
|
Hi,
These step will guide u to create a Virtual Directory in Windows XP:
1. From the Start menu, click Start, Settings, Control Panel, Administrative Tools, Internet Information Services
OR
Start - Run - type inetmgr
2. In Internet Information Services, expand your computer name, expand the websites and right click websites - select - New, Virtual Directory
3. In the first screen of the Virtual Directory Creation Wizard, type an alias, or name, for the virtual directory (such as MyWebData), and then click Next. It can be the name of the folder where you have the aspx files.
4. In the second screen, click Browse. Locate the folder where you have the aspx and cs files. Click Next.
5. In the third screen, select Read and Run scripts (such as ASP). Make sure that the other check boxes are cleared. Click Finish to complete the wizard.
6. For ASP content, you may want to confirm that an application was created. To do this, right-click the new virtual directory, and then click Properties.
7. On the Virtual Directory tab, make sure that the virtual directory name is listed in the Application Name box under Application Settings. If it is not, click Create. Note that the application name does not have to match the virtual directory alias.
8. Close the Properties dialog box
You can create an almost unlimited number of virtual directories for your service, although performance may suffer if you create too many of them. For further reading, you may refer:
http://msdn2.microsoft.com/en-us/library/zwk103ab.aspx
Regards
|
|
|
|
|
Start > Run > inetmgr and press ENTER
navigate to Default Websites folder on the left hand tree view, right click on it and select "New > Virtual Directory" and press Enter...ur VD will be created
|
|
|
|
|
I have a windows form with a rapidly updating chart and I want to use the "double buffered" setting to prevent flicker. The problem is it always gives me an Argument Exception with the message "Parameter is not valid" when the form loads. Does anyone know what I am doing wrong?
Thanks in advance for any help you can offer.
|
|
|
|
|
Richard W Allen wrote: Does anyone know what I am doing wrong?
Yes and no: here's your problem
Richard W Allen wrote: "Parameter is not valid" when the form loads.
Without some code we can't do anything else.
|
|
|
|
|
I'm not sure that code would help. The exception occurs on the line:
Application.Run(new SC226());
If I have Double Buffered set to false my application runs OK but I do get flicker on my chart. If I set Double Buffered to true, my application starts OK, but I get the exception when I open the Double Buffered form.
I am not sure how to interpret the exception details, but there are a lot of references to "System.Drawing.Graphics" and "System.Drawing.BufferedGraphics"
|
|
|
|
|
Richard W Allen wrote: I am not sure how to interpret the exception details, but there are a lot of references to "System.Drawing.Graphics" and "System.Drawing.BufferedGraphics"
Then just paste it, maybe one of us can help
|
|
|
|
|
Here are the exception details:-
System.ArgumentException was unhandled
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.Graphics.GetHdc()
at System.Drawing.BufferedGraphics.RenderInternal(HandleRef refTargetDC, BufferedGraphics buffer)
at System.Drawing.BufferedGraphics.Render()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SC225.Program.Main() in C:\Documents and Settings\Richard Allen\My Documents\Visual Studio 2005\Projects\SC225\SC225\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
|
|
|
Sorry, I cant seem to help you on this one
I suggest however, you try find out the 'this' context of the COntrol at 'System.Windows.Forms.Control.WmPaint(Message& m)' (just go down the callstack). Then remove that control temporarily, and try again.
|
|
|
|
|
Maybe this might cast more light on the problem:
The exception occurs in the line:-
Application.Run(new SC226());
but SC226 is my application, so shouldn't this line only run when the application starts?
If I have Double Buffering off, this line only runs at the start of my app. If Double buffering is on, it runs again straight after the paint method of the form that is double buffered. But why??!!! Is something causing my app to reset?
|
|
|
|
|
Hi
what is the property name for reading 'web page' of the user from active directory.
may i have complete list of the property for windows server 2003?
Thank you
Jayesh Talsaniya
Jayesh Talsaniya
|
|
|
|
|
how can make a userdefine collection in c# and what's delegate(c#) with example?
Thanku sir/madam
|
|
|
|
|