|
A potentially dangerous Request.Form value was detected from the client.
I have a webpage using .net 2.0 with
an asp:button Back and
a textbox with text = "<space>"
I've done my research and everything I see says set ValidateRequest="false" in page directive which I did.
There's no problem if I click the browsers back button. But when I click my own asp button BtnBack, the error is produced. Is there something like setting the validation within my own button?
Thanks!
|
|
|
|
|
Hi,
When browser back button is clicked, no new request is sent to browser, I think(unless we expire the page programmatically). Most probably, you have written a Response.Redirect in your asp button click, right? So, the html code gets posted to the server and server generates the error.
You can either call History.Back(or something like that in javascript) in your button click or you can set ValidateRequest = "True"
Regards,
Jim
|
|
|
|
|
A potentially dangerous Request.Form value was detected from the client.
I have a webpage using .net 2.0 with
an asp:button Back and
a textbox with text = "<space>"
I've done my research and everything I see says set ValidateRequest="false" in page directive which I did.
There's no problem if I click the browsers back button. But when I click my own asp button BtnBack, the error is produced. Is there something like setting the validation within my own button?
Thanks!
|
|
|
|
|
I have bound a "Decimal" field to my DataGridView control.I've gotten precision and scale of this column's value but i am in wonder how to get these values declared in SQL for this field?
Thanks and waiting for your replies ...
|
|
|
|
|
select numeric_precision, numeric_scale
from information_schema.columns
where table_catalog = 'MyDatabaseName'
and table_name = 'MyTableName'
and column_name = 'MyColumnName'
|
|
|
|
|
Hi there,
I have an urgent need for help. I'm currently on a project where I'm developing an Indigo service
(CTP Feb 2006) which is hosted in IIS 6.0 on a Windows 2003 server. This service needs to access a COM component.
First, I tried registering it on the server (regsvr32) and accessing it, but I always get E_NOINTERFACE.
Second I tried to isolate the component and deploy it with a manifest.
But it still doesn't work. I get another COM error (Sorry, don't remeber the actual number but it was something like 80040154).
Now I actually have two questions:
1. Can anyone tell me what I'm doing wrong, and
2. Does anyone know if the isolation of COM components is possible on W2K3 server.
Many thanks in advance
|
|
|
|
|
Good day to all,
Currently im developing an administrative tool that allows me to monitor all workstation under my domain. I want to do remote shutdown/restart/log-off using C#. At first I was thinking of executing the ff:
shutdown -r -f -m \\pcname -t 0 for restart..
shutdown -s -f -m \\pcname -t 0 for shutdown..
I planned to execute it under C# Process & ProcessStartInfo however i feel i doesnt much have control because whenever i shutdown/restart an offline pc, if it is on command line, then it will just hang-up or just a cursor blinking and will not exit the command (maybe it would take too long..). I hope somebody could help me find a way to execute shutdown/restart/log-off remotely which we have better control and more reliable way. Also also want to get remotely,the processes that runs under the client machine/workstation, i hope this is feasible in C#.
Im using .NET 2003 environment,
thanks a lot,
-- modified at 2:39 Friday 17th March, 2006
|
|
|
|
|
Try this :
string t = "-r -c \"I am going to reboot your mechine\" -t 20";
Process process = new Process();
process.StartInfo.FileName = "shutdown.exe ";
process.StartInfo.Arguments = t;
process.Start();
I think this will solve your problem.
Cheers
Jijo
|
|
|
|
|
Hi Jijo,
Thanks for your reply. I guess i will just have to use shutdown.exe and continue using Process and ProcessStartInfo.
More power to you!
|
|
|
|
|
Hello, I would like to know how to embed an application into a window form using framework 2.0.
anyhelp will be appreciated. Thanks
|
|
|
|
|
i have a .net component which is registered for com interop. now when i install the the setup. it stores the file under program files. But i want to add this .net component to GAC on Target server. How can i do this? is there any code to do this?
|
|
|
|
|
Hello,
I'm working on a localized project and have the following problem now:
PROBLEM:
The Visual-Studio-2003-Designer does not show the correct language. What i did is that:
WAY:
1. Create a new WindowsForm-Project and place a button on the form.
2. Add a new userControl and place a button in the userControl (compile it).
3. Place the userControl on the Form.
4. Localize the project to "invariant", "german", "english"... (compile...)
I named all buttons according to the localized language (invairant, german, english).
EFFECTS:
When I now open the Form with the designer, and the language of the Form is set to "invariant", the button of the form is named "invariant" but the button of the control is named "german". It doesnt matter in wich language set when I compile the userComponent. Most of the time it's "german" (sometimes I saw "invariant" but I couldnt figure out why ).
During runtime everything works normal and I can see the language that is set in "System.Threading.Thread.CurrentThread.CurrentUICulture".
PRESUMPTIONS:
I suppose that it may depend on the language of the Visual Studio or on the language of Windows (both is german in my case). But I would like to understand WHY EXACTLY this happens (and what I can do to prevent it).
Thanks in advance
Snow
|
|
|
|
|
how can i use a assembly(dll) reference in runtime?
|
|
|
|
|
vatzcar wrote: how can i use a assembly(dll) reference in runtime?
Have a look at the Assembly class. You can load an assembly with Assembly.LoadFile() and get its types with Assembly.GetTypes(). Activator.CreateInstance() will create an object of a given type.
Does that answer your question?
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
Vikram A Punathambekar wrote: Does that answer your question?
Yes. and thanx a lot for the help
|
|
|
|
|
Hi ,
I am using couple of pages with a master page in asp.net application.
one of the page works fine when i debug the application but when i am debuggifn another page i get the error.
"Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpmodules> section in the application configuration"
Could anyone help me on this.
If i run the application as a published website,it works fine but once i go to debug mode, it shows an error on the line in master page where session["user"] is there.
this error is not shown wnhe debuggin another page of same application.
Regards,
Sama
|
|
|
|
|
Hi
I am using ASP.NET and C#. When I load imgae from the directory mydocuments/mypiactures, it works fine. but when load that image from any other location it gives error. below is the code:
Image1.ImageUrl = "";
bmp = new Bitmap(Upload.PostedFile.FileName);
h = bmp.Height;
w = bmp.Width;
if ((h == 133) && w == 274)
{
int len = Upload.PostedFile.ContentLength;
string imgtype = Upload.PostedFile.ContentType;
string imgtitle = "Logo";
byte[] imgdata = new byte[len];
Upload.PostedFile.InputStream.Read (imgdata, 0, len);
Image1.ImageUrl = Upload.PostedFile.FileName;
//Insert the image and comment into the database
companyDetails.InsertLogo(imgtitle, imgtype, imgdata, 1);
....for example if i load image from desktop it will give error. I think that asp code does not have access to personal files or folders. IF that is the reason then how do we give acces to personal files and folders.
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
hi
I want to collapse and expand categories in the property grid.The proeprty grid allows me to expand/collapse all the categories but my requirement is to expand/collapse some categories.
Any suggestions
-- modified at 23:34 Thursday 16th March, 2006
|
|
|
|
|
Could someone please guide me through the working of the 'PropertyTab' property of a propertygrid object. I need to add a page on the toolbar of a propertygrid control for events, similar to the 'events' page on the standard properties floating pane in the Visual Studio .NET IDE.
|
|
|
|
|
Hi,
I have a C# windows application that sends pages of a file to the printer spooler. It is a test tool that should tell me how many pages are spooled at every instance.
I am imagining the test tool to be just like the spooler visible in the system tray with a difference that the tool should have the time stamp of each page spooling. I want to be notified on every page spooling.
Any pointers on how to do it are most welcome.
Thanks,
Roy
|
|
|
|
|
Has anyone had any experience with, or advice on how add named pipe functionality to an otherwise run of the mill C# Windows Form application?
I've got a project to write a utility to interface a special piece of hardware (a custom video camera which has a C# .NET namespace provided by the maker) to another master control program.
The problem is the master program is an old legacy program that only gives remote commands (start, stop, report status, etc.) using named pipes.
I've searched through my C# and .NET references and don't see any namespaces or managed classes to provide named pipe remoting access.
My best guess is somehow import them through the Win32 api functions, but my search efforts so far haven't given me any examples close enough to what I need to really get a good feel for how to go about this.
This was pretty straight forward back in the old VC 6 days using MFC functions, but I don't think they made it to C# yet.
Any advice, recommendations, links or examples would be most welcome (except telling me not to use named pipes or C# .NET, those are the two things I have no control over). Oh, and if it makes any difference (probably makes it worse with my luck) I'm using VS 2003 and .NET 1.1. Having enough fun going from my comfy old VC++ to C# as it is, without having to leap to the changes they made in 2.0 and 2005.
|
|
|
|
|
TCP/IP sent to localhost, uses Named Pipes under the hood I'm told. That's a reasonable swap.
Otherwise you have two basic options. If you want to use Named Pipes in C# for a general mechansism then its off to P/Invoke land. But unless you have to interface to an older C/C++ program that used Named Pipes, you might consider leveraging some of C#'s data structures and particularly the TCP classes.
Secondly, if you are using SQL Server, Microsoft has carried over Named Pipes for that. That's easy to take advantage of.
I guess there is one 3rd option which may or may not make sense. Since you have a heap of code in C++, you could hobble together a C# callable DLL and provide the underlying Named Pipe support.
In sum, Named Pipes appear to have been relegated to performance driven 3GL/2GL apps. With some effort you can force an implementation in C# but you have to ask: "why am I doing this?"
Good luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
mcljava wrote: TCP/IP sent to localhost, uses Named Pipes under the hood I'm told. That's a reasonable swap.
Otherwise you have two basic options. If you want to use Named Pipes in C# for a general mechansism then its off to P/Invoke land. But unless you have to interface to an older C/C++ program that used Named Pipes, you might consider leveraging some of C#'s data structures and particularly the TCP classes.
Secondly, if you are using SQL Server, Microsoft has carried over Named Pipes for that. That's easy to take advantage of.
Yeah, but the trick is figuring out how to use these classes and if they will actually work or not.
I have no control over the other program I'm interfacing with, I just have a pair of named pipes for talking and listening and a list of commands I can expect to receive and replies I need to make.
Whether the TCP classes happen to use pipes or not doesn't mean anything to me. I need to open a specific pipe, wait for a command from another program (which is not of my design or control) and give it a response telling it my status. That program uses named pipes and it's the only hook available for communication.
mcljava wrote: Secondly, if you are using SQL Server, Microsoft has carried over Named Pipes for that. That's easy to take advantage of.
Nope, not using SQL server.
mcljava wrote: With some effort you can force an implementation in C# but you have to ask: "why am I doing this?"
Well, I'm doing it because that's my job...LOL. Unfortunately every time a new technology comes along half the world jumps on the bandwagon thinking it's the next best thing since cake and the other half is relegated to trying to make it work with all the stuff that's been done before. In this example, I have a c# .NET namespace which is the only way to access one piece of hardware, and a named pipe scheme which is the only way to talk to the master program. I'm caught in the middle and have no say in how either one is done.
I really appreciate you giving this one a shot, truly, but I'm afraid I'm left just as confused as to how to accomplish this as I was before.
Anyone know of any books, texts, articles that covers this, or at least dance around the topic enough that I might glean some ideas?
Could there be some way to tap into named pipes using the Win32 API? The Win32 API examples I've seen all look awfully ugly when brought into C# and none even come close to touching on named pipes as far as I can find.
All hints and suggestions welcomed
Phil
|
|
|
|
|
Phil,
Fire up google, and ... "C# named pipes" - it will lead you to at least a dozen or so C# Named Pipe Examples.
Good Luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
Ah whew...I looked again, thanks.
Obviously this was the first thing I did when I first took this on. Perhaps my google skills need polish, I don't know.
Everything I found seemed to be pointed at the new IPC remoting stuff that's in .NET 2.0.
I Found an example on codeguru and it does compile and run with my 1.1, so I'm golden. It's buried inside InterProcessCommunication stuff. I guess since my C++ and MFC experience all had it built into CreateFile and it was right up front and as basic as opening a file I assumed the CSharp would be there too (obviously it isn't)
Thanks for the gentle shove in the right direction
Just what I needed.
|
|
|
|