|
You are in essence "eating" the exception (if the code above is the actual code you're using). Put a breakpoint on the first bracket and run the code under the debugger. It should stop at the breakpoint.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Is it really an empty catch block or you removed the code inside it for the post? Never ever have an empty catch block. Also, never use try/catch/finally as if they are same as if/else. I, personally, would prefer checking for the permission and then deciding the flow.
|
|
|
|
|
Hi ,
I am using asp.net using c#. In my ascx page, i included asp.net controls like textbox labels gridview.... in the ascx page, i dont see any div or tr tags.. but when i run the program, i can see those in fire bug. Well some div are ok but some are nested div . Some tags are even unnecessary to me. is there any way i can remove those tags ? any ideas ??
suchita
|
|
|
|
|
Those tags are probably generated by the html renderer for the controls you are using on the control. The only tags I think you can remove are the ones you have placed yourself in the script for your control.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
ya i think so too.
suchita
|
|
|
|
|
This question should be posted on the asp.net forum.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
The reason that extra content is rendering is because you are creating a User Control and not a Custom Control. In order to fully control the rendering of your control you will need to make Custom/Server Control.
Walkthrough: Developing and Using a Custom Web Server Control[^]
Don't comment your code - it was hard to write, it should be hard to read!
|
|
|
|
|
This belongs to ASP.Net forum.
Those tags occur because of the way ASP.Net server controls are rendered on screen. You can create a simple web page with a GridView and some hardcoded data in it. Just see how it is rendered.
Basically, .Net specific tags what we see in an ASPX/ASCX file are alien for a browser. It understands HTML and some scripting languages only. So, what .Net has done is, made our life easier. We can put in a GridView in ASPX set the properties and when the page is rendered on screen, that tag is converted to it's equivalent HTML.
|
|
|
|
|
I have the need to build a client-server system. It will all be working on an intranet, distributed on multiple PCs.
One will be a server application, hosted on a PC, that will manage the data.
The second will be a client application. It will be used to read and modify the data. This application already exists, for the most, and is a C++ application. It is huge so it cannot be done from scratch again. I have seen that I can expose a COM interface from .Net, so I will probably do a library that will be used as an interface between my old C++ app and the .Net architecture.
I also need the server to be able to send notifications to the client applications when some changes occurs, so I need a subscription mechanism.
I am relatively new to .Net so I am not sure what the best technology is.
I have looked at WCF, but it does not seem ideal for the subscription/notification part. Am I wrong?
What else is there that could be better?
|
|
|
|
|
Instead of the COM dll you might consider using managed C++ for the old app. This will let you mix both managed (.NET) and unmanaged code in the same files and will give you all of the .NET stuff you might want.
The other stuff, someone else might have to comment on.
I use c# for my client server apps but I use straight sockets for my information.
|
|
|
|
|
Thanks for the suggestion.
I forgot to mention that the C++ app is still running in VC6, and unfortunately there is no plan to migrate it yet. So C++/CLI is out of the picture, though I had a look at it. Such a shame...
|
|
|
|
|
I cannot tell you if WCF would be ideal for subscription/notification part, I don't know, but it can be done with WCF. You can find an example here[^] about WCF callbacks.
|
|
|
|
|
Thanks, I will have a look at that.
|
|
|
|
|
I have an application which is using an image which is picked up from a resource file.
i have this exception-
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"WindowAplication1.Properties.Resources.resources\" was correctly embedded or linked into assembly \"WindowApplication1\" at compile time, or that all the satellite assemblies required are loadable and fully signed."}
How can I handle this???
Thanks in adv...
|
|
|
|
|
The clues are in the question:
1) Make sure "WindowAplication1.Properties.Resources.resources" was correctly embedded or linked into assembly "WindowApplication1" at compile time
2) All the satellite assemblies required are loadable and fully signed.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Dear All --
Forgive me if I am being greedy. Upon writing a function header say "Private void FntName()" is there a way the two curly braces and the try catch block is automatically inserted.
cheers
|
|
|
|
|
If you're using VS I guess this could be done by creating code snippets.
|
|
|
|
|
Calla --
Yup I am using VS 2005. But I want it automated. How will I trigger it ?
cheers
|
|
|
|
|
You may wish to ask yourself why you want to insert a try-catch into every method you are creating. That is no way to trap errors properly. It will just make the entire application nearly impossible to effectively debug the application.
If you do wish to do it, look up on how to creating studio add-ins. You may want to tie in that way to automate the process with no user intervention(i.e. keystrokes), but the logical way would be to create a snippet, and assign a keystroke to it so that you only have to type that to get the whole block inserted.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I'm with PogoboyKramer on this - try catch round each and every method just look like you are saying "I don't know what I am doing, so I'll try and ignore as many problems as I can instead of fixing the problems behind them"
Smacks to me of VB's "On Error Resume Next"
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: On Error Resume Next
Goto Happyland
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
PogoboyKramer wrote: Goto VeryUnHappyland if you are the poor sod maintaining it...
FTFY!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Reading between the lines... You've worked with BA's before
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Who hasn't?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
If you like removing said Try/Catch blocks all the time, this would be a good idea. But, it's a horrible idea to put a try/catch block in every method. You're not really doing/handling exceptions properly if this is the case, but instead making a nightmare of debugging your app.
|
|
|
|