|
Hi,
I have a web service and if my web method catches an exception I then throw a new exception which is passed back to my calling application. Unfortunately though my exception has text XXXXXXX, it gets a load of other stuff added like this:
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: ..."
It looks like I'm getting the inner exception trace.
How can I avoid this?
Thanks
|
|
|
|
|
Hi Friends
I am trying to pass value to my Session Variable from Javascript method.
function TestOne
{
var stringOne= "test";
Session.Add("Test", stringOne);
}
I am getting an error Session is undefined.
Any suggestions would be appreicated.
Thanks
Cheers
Menon
|
|
|
|
|
Session is a Sever object not client, so you cannot access it in javascript code. You have to pass the string to the server either through querystring or through any form field and then get it on the server and add it to the session
-----
|
|
|
|
|
Thanks Bhatti,
Can you please tell me how do you call a server side method from the Javascript?
Thanks
Cheers
Menon
|
|
|
|
|
What are you really trying to do? You are in ASP.NET forum which means you have an idea how web forms works. So basically you add a ASP:Button in you page and onclientclick you call the javascript function, in that function you change the value of any hidden field or regular textbox and submit the form. And on server side you add the click handler to the button and in that eevnt handler you get the value of that field.
Please go through quickstart tutorials[^] to understand the whole flow.
e.g. you will call the following javascript function onclicentclick of the button:
<br />
function TestOne()<br />
{<br />
document.myform.stringOne.value = 'stringOne';<br />
docuemt.myform.submit();<br />
}<br />
and on server side in event handler for click event of button you will do this:
<br />
Session["Test"] = stringOne.Value;<br />
-----
|
|
|
|
|
Hi all,
I have a multiline text box . I wan`t the user entered data to be filled in a single column of the table.But since the user can enter more than one line (by pressing enter or wrap i suppose).
It gives me an error that the data would be truncated. How should i enter the entire data in DB?
Also while reading i need to read it as a ordered list..How can we do that?
Any help would be highly appreciated
|
|
|
|
|
from the error it you are trying to save data that is larger than the allowed size in database. So either restrict the user to enter data for allowed size or increase the size in database.
newbie.net wrote: Also while reading i need to read it as a ordered list..How can we do that?
what you mean by "you want to read it as ordered list"?
-----
|
|
|
|
|
I have read a couple articles on how to encrypt portions of the web.config via command line, but is there any way to do something simillar when console/command line access is not available? such as in a hosted environment? I could possible make a request to the company hosting my asp.Net 2.0 site, but I thought that I had viewed a tutorial some time back where someone did it programatically.
P.S. Let me say to anyone that has noticed that this is my third quest for help this morning... I am new to this forum and promise to contribute back to the forum by helping others where I can. 8-)
|
|
|
|
|
What about doing this via cmd on your localmachine and update this portion in web.config from your host??
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
|
That first link is exactly what I was looking for.
Thank you ever so much for saving me bunches of time!
,Gary
|
|
|
|
|
I am using the onClick event to send an email using System.Net.Mail.
It works great. If I add a 'PostBackURL' to the asp button on my form to point to a confirmation page, that works but it breaks the sending of my email.
Is there a way, within my C# code behind, that I can send the user to the confirmation page after the mail sending?
|
|
|
|
|
use response.redirect to send the user to confirmation page after sending email
-----
|
|
|
|
|
Thanks again !!
SABhatti... do you live here(Code Project forums)?
LOL
|
|
|
|
|
nope I live in NY
-----
|
|
|
|
|
I was entering a blog entry in one of our company's web apps, and I got this error when I submitted the post:
A potentially dangerous Request.Form value was detected from the client (_ctl0:cph_Main:_ctl0:_ctl0:postBackBody="...refighter.<br/>
<br/>
Well, ...").
Has anyone every seen anything like this before?
-- modified at 10:28 Monday 26th November, 2007
I deleted the text I thought was creating the problem, because it doesn't seem to matter what I put in there.
-- modified at 10:29 Monday 26th November, 2007
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Has anyone every seen anything like this before?
Yeah. If the user entry the HTML tag in your page, you will get this error..
You can read No.6 as below from my post Some FAQ from ASP.NET web development.
6. Protecting an ASP.NET page against malicious input with ValidateRequest (A potentially dangerous Request.Form value was detected)
When your project is in testing state, you should try to test your application by entering script tag (eg: <script lanague=”javascript”>) or HTML tag (eg: <html><strong>) or #@ or @# characters. And see what happen.. You may probably get the error.. If you don’t wanna get this error then you have to set the page directive validateRequest to false. Note that your page might has the security problem.
Ref: http://codebetter.com/blogs/peter.van.ooijen/archive/2005/10/21/133505.aspex
Hope it helps..
-- modified at 11:14 Monday 26th November, 2007
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
It may be that your post included tag symbols < and/or > which are, as the error said, "potentialy dangerous". Try removing them, or replacing with < and > and try again...
You can prevent this by adding a
ValidateRequest="False"
page directive but you should only do this if you trust anyone who is able to post to this page, or else parse their input very carefully...
cheers
fred
|
|
|
|
|
The post itself doesn't have any tags or formatting inlcuded by me, but it appears as if the javascript editor that the blog code uses adds the tags as I type. I'm not going to set the ValidateRequest to false (for obvious reasons, but I may have to recommend that we find a different editor.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's easy to get paranoid about this sort of thing, but after all these CP forums use just such an editor - allowing html tags to be posted back to the server - and AFAIK the world hasn't ended... yet!
|
|
|
|
|
John Simmons / outlaw programmer wrote: I was entering a blog entry in one of our company's web apps, and I got this error when I submitted the post
It means the app was written by idiots who don't test. We have them writing web apps for us too. They're instantly recognizable by their ridiculously long (for something with few users on an internal server) load times and complete lack of any working contact or bug reporting information.
---- ...the wind blows over it and it is gone, and its place remembers it no more...
|
|
|
|
|
When ever I try to reset the dropdown by javascript a page load happens. Could you please let me know how can I reset the listbox or dropdown value.
My code is as below on ASP.NET page load is as below:
Button1.Attributes.Add("onClick", "document.getElementById('<% =FromHyperlink.ClientID %>').selectedIndex=1; return false;");
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
<br />
Button1.Attributes.Add("onClick", string.Format("javascript:document.getElementById('{0}').selectedIndex=1; return false;",FromHyperlink.ClientID )); <br />
-----
|
|
|
|
|
Hi,
I am in need to use custom membership provider with Custom DB Schema. The new schema defined has some additional fields against those defined by default schema. In the overridable method CreateUser i am not able to pass the remaining field values (since it is overriding the method signature defined in the MembershipProvider class) for further processing... Is there any approach to overcome this problem ? Thanx in advance.
Prashanth Nandi
|
|
|
|
|
I want to know how to use find control in gridview.if any one know please help its urgent..
Rock Star
|
|
|
|