|
I design a webservice with c#,
this webservice have some [WebMethod(EnableSession=true)]'s method
but when I use it with c++,Session lose
why?
thanks, codeproject
|
|
|
|
|
**CROSSPOSTED TO VS .NET IDE ISSUES FORUM**
Hi all,
I've got a class called RowView derived from UserControl, which is itself the parent of another class (AuthorView).
RowView has a public property Data. Since RowView should never be instantiated directly (it's a pseudo-abstract class) it doesn't implement Data, it simply throws a NotSupportedException. My AuthorView class does implement Data.
Now my problem is that whenever I try and 'design' AuthorView in VS .NET the designer tries to access RowView.Data, which throws an exception.
So my question is, how do I stop VS .NET's designer from attempting to access Data. I've tried settig the Browsable attribute to false in RowView.Data, but it doesn't help.
I can post up some code if that'll help clarify the situation.
TIA,
Pete
|
|
|
|
|
you can always chekc if you are in designmode (this.designmode) and NOT throw the exception if you are in design mode..
not that this is a solution but i suppose it will atleast let you continue working on your controls untill you find a solution for this...
//Roger
|
|
|
|
|
Funny, that's exactly what I did do
And I was thinking the same thing: "Hmm, this can't be the right way to do this... Ah well, at least I can keep coding while I wait for some kind of solution.."
Thanks Roger,
Pete
|
|
|
|
|
Anyone know how I can get a control to validate itself?
I have a nice event handler for Validating which changes the colour of a textbox if it's contents aren't suitable. I'd like the controls to initially start out in the correct state, but at the moment they only validate themselves if I focus on them then defocus. Any ideas?
TIA,
Pete
|
|
|
|
|
If you have small number of controls to validate It is a fine idea to do so with a schema like: (OnFocus - OnBlur)
But if the number of controls is large say 20-25 controls then it is always a good idea to validate controls using a seperate routine.
If you want your controls to be self sufficient you can derive them from existing controls then override and add new properties.
Override the required events (e.g. Focus etc...)
Provide a Delegate
Add new event handler
And do any thing you want in the handler
Hope this helps
Happy Programming
-- Sumeet
|
|
|
|
|
Hi all,
can anyone see anything glaringly wrong with this:
public class NumberBox : TextBox
{
protected override void OnKeyPress( KeyPressEventArgs e )
{
if( !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar) )
e.Handled = true;
base.OnKeyPress( e );
}
}
It doesn't have to be super-secure or anything (I don't care about Ctrl-V etc) cause I validate the control's Text later anyway, it's just a quick and easy way to persuade my lovely users to only enter numbers.
So I was just wondering if anyone can spot any usability problems with this? I'm not worried about
negative numberspasting in incorrect data, etcdecimal points and thousand seperatorsTIA,
Pete
|
|
|
|
|
Looks fine to me! Are you getting errors?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
No, I was just wondering if there were some subtle caveats that I'd missed - that always seems to be the way when I play with new class libraries
|
|
|
|
|
You're still calling base.OnKeyPress , which will just let TextBox handle it. Your code should read:
if ( !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar) )
{
e.Handled = true;
return;
}
base.OnKeyPress(e);
|
|
|
|
|
I know I'm still calling OnKeyPress(). It seems to work that way, because e.Handled = true. I wasn't sure wether to call it or not, I figured that it was best to call it just in case the Framework has to do some kind of housekeeping.
|
|
|
|
|
Nah, the e.Handled takes care of the underlying Win32 housekeeping behind the scenes.
[I'm sure you realize this, but my comments below are for our gentle OOP neophytes out there...]
You should only call base functions a) if they're required (see the reference dox for the base methods) or b) if you wish to use the default base implementation.
In the case of your derived TextBox class, you wouldn't want to call base.OnKeyPress() because you don't want the default behavior.
|
|
|
|
|
I see what you mean.
I guess I'm finding it a little hard to get used to C# properties. It didn't really occur to me that a simple boolean 'assignment' could actually kickoff a lot of behind-the-scenes processing.
My thinking was "Ok, I'll set e.Handled then pass it to the base method so it knows I've dealt with it" Baby steps...
Thanks Ian,
Pete
|
|
|
|
|
I've got a .NET class that's being hosted for remoting by IIS (NOT a WebService). Works fine, except for debugging it...
How can I debug it with Visual Studio.NET? What kind of VS.NET project would I use? In particular, how can I configure VS.NET to allow me to breakpoint in the remoted class?
Thanks!
|
|
|
|
|
I recieve this error when running the Hello World .NET sample web service on windows XP Professional with IIS 5x. What am I missing?
Regards,
Ron
System.IO.FileNotFoundException: File or assembly name ogvvgnwu.dll, or one of its dependencies, was not found.
File name: "ogvvgnwu.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
Fusion log follows:
=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\WINDOWS\TEMP\ogvvgnwu.dll
LOG: Appbase = file:///c:/inetpub/wwwroot/RainMakerLists
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/TEMP/ogvvgnwu.dll.
|
|
|
|
|
|
What I really need to know is where is the uninstall program/msi for the .NET framework?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
|
You should probably rebuild your machine, but as a last resort, you could use the Windows Installer Cleanup utility to remove the references to the beta.
http://support.microsoft.com/default.aspx?scid=KB;en-us;q240116[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Thanks so much for your info! The Installer Cleanup Utility did it! I'm very relieved, because I could not afford the 12+ hours it would take to rebuild.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
How can I get the same graphic user interface form browser and form applications in DotNet?
Thanks,
Renato Oliveira
|
|
|
|
|
VS.NET IDE / Toolbox / Right-click / Customize / Browse Microsoft Internet Explorer. Drag&drop it onto your form. You are done (almost).
|
|
|
|
|
We have a server product for which third-parties can create installable applications. The applications are written as COM components. As such, we've generated a pair of Primary Interop Assemblies for the components needed for the application to talk to the server.
We've created a deployment package using Visual Studio.NET which installs the PIAs to the Global Assembly Cache. It doesn't however currently install to the Primary Interop Assemblies directory from which VS.NET finds available PIAs.
I can create a 'Program Files\Microsoft.NET\Primary Interop Assemblies' directory as part of the installer; is this going to work on non-English systems, or should I be trying to find the right folder through the registry, or some Windows Installer property?
<shameless plug> More info on the server at http://www.5d.co.uk/Meteor.htm.
--
Mike Dimmick
|
|
|
|
|
You can install assemblies anywhere you want.
|
|
|
|
|
I possibly didn't explain this well enough.
We're supplying the server software as a single kit, including both the server itself and the software development kit for developing third-party applications.
Visual Studio.NET will display in the References dialog's .NET tab any assemblies installed in the Primary Interop Assemblies directory. On an English system, this directory defaults to %ProgramFiles%\Microsoft.NET\Primary Interop Assemblies (by default, this contains the PIAs for e.g. classic ADO [in adodb.dll]). Installing in this directory means that the developer doesn't have to browse for the PIAs.
What I wanted to know was, is the name of this directory (i.e. %ProgramFiles%\Microsoft.NET\Primary Interop Assemblies) the same on all locales, or is it localised?
Since the PIAs reference COM components, we install a copy into the Global Assembly Cache (GAC) for run time, but VS.NET and the compile tools don't appear to look there at design time or compile time.
--
Mike Dimmick
|
|
|
|