|
Why do you use Session to store files.... It is the highest possiblity of the user to upload a large file and eat up all the memory of the server..
Think it will be better to write in disk rather than using memory for file upload.
Abhishek Sur
|
|
|
|
|
Thanks for the reply.
Yes thats good idea.
I shall keep these attatched files in the Temperory folder of the server
after the processing and uploading I will remove this files..
|
|
|
|
|
Hi,
I have to call a Java Web Service from a .Net Client .I'm using VS2008 (.net 3.5).
Web service was developed with Java. It is installed on a Tomcat server.
The web service offers some methods. A group of methods returns a xml file and a xml attachment.
A group of methods accepts a xml file and a file attachment.
How can I manage this situation ?
I saw different articles and documentation pages.
What's the best strategy ?
I read something about create a VS2005 project with WSE 3.0 and import it in VS2008.
I found notes about WCF ( I don't know WCF . It's the right tool ? ).
I tried a solution like this :
http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx
I tested article's code. It seems that is no way to manage attachment ...
When I invoked a method I saw this error . "The content type application/dime of the response
message does not match the content type of the binding (text/xml; charset=utf-8).
If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.".
My custom code ( more or less)
WebApp.MyReference.WSMethodClient myMethod = newWebApp.MyReference.WSMethodClient();
// return a xml string and a attachment to soap message. I get xml string , but how can get attachment ?
string l_var = myMethod.service( p_CodApplication, p_UserName, p_Password );
How can I manage the attachment ? How can I manage soap messages with VS2008 ?
Could you help me ?
|
|
|
|
|
Pick one forum and stick with it. Don't cross post just because you don't receive an answer immediately.
only two letters away from being an asset
|
|
|
|
|
Ok ! I'm sorry. I wasn't sure about the right forum ...
|
|
|
|
|
Hi,
I have two Forms in my web application using c#.
Form1:
Opens a folder and checks for latest file (ex: Text1.txt)
Increments the number by 1 and creates a new text file with new number (ex: Text2.txt)
Form2:
Opens new file (ex Text2.txt) and reads line by line and writes to Form
Every time the page is submitted, a new text file is created, so I made the number assigned to the text file an integer and assigned the file name using the following code:
StreamWriter sw;
sw=File.CreateText(@"C:\Desktop\Text" +x +".txt");
sw.Close();
I am having a problem passing the exact file name from Form 1 to Form 2. I want the file to be created on the button click in form 1 but it must be open and read in the timer of form2.
Please help if you can, especially with code examples. I'm completely stuck!
Thanks
|
|
|
|
|
What exactly are you having difficulties with? What have you tried.
Terick wrote: especially with code examples
The people most likely to give you the proper answer will not give you the code without seeing that you are trying yourself first.
only two letters away from being an asset
|
|
|
|
|
if this is a web application then why you are using c:\ .... it should be ~\\Files\\xxx.
to pass data between web forms there are many ways. but you can use Session.
in Form 1 at the Button Click.
StreamWriter sw;
string TextFile = @"C:\Desktop\Text" +x +".txt"
sw=File.CreateText(TextFile);
StreamWriter sw;
Session["TextFile"] = TextFile;
and in Form 2 Page_Load
string TextFile = (string) Session["TextFile"];
but still you need to read more about Session and File Handling.
|
|
|
|
|
I'm using C:\ because I'm running this on the localhost and the file is shared on my network. The text file is then picked up by a program on another machine on the network. This program will make changes that my machine reads out in form 2. Is there a better way to save this text file that can still achieve these results? I'm not familiar with ~\\Files\\xxxx
Thank you for your advice on the session state. I will try that.
|
|
|
|
|
Rutvik,
Thank you for your suggestion of using Session. This worked exactly as I hoped. The only thing I changed was that I placed the text from Form2 in my timer_tick and it worked.
Thanks again!
|
|
|
|
|
I have created an xsd that is well-formed. I have generated classes for the xsd with xsd.exe. I am able to use dot notation to write code to access and set values for all of the attributes.
The problem is that during runtime the child elements are null. Consider the following example where I am trying to set the horsepower attribute value of a Car Engine to 250:
myCar.Engine.horsepower = 250
In this example, Engine is null. However, when I instantiate Car (myCar) I expect the Car instance to automatically have an Engine that I can access to set properties.
I assume that this is probably a problem with my xsd configuration. Can you think of what may need to be changed with my xsd in order to enable the use case that I am describing?
|
|
|
|
|
I am storing an object in a user control's viewstate. This object contains a reference to another object. After retrieving the object from the viewstate, the referenced object is no longer the same as the original (pre-viewstate_referencedobject IS post-viewstate_referencedobject returns false).
Does anyone know how to preserve object references through viewstate?
If you further clarification or code samples, just let me know.
Thanks in advance for your consideration.
modified on Wednesday, January 21, 2009 4:47 PM
|
|
|
|
|
Kindly let me know, how exactly are you referencing the viewstate and what exactly do you require. I mean the complete process.
-----Have A Nice Day-----
|
|
|
|
|
My Results page take 30 seconds or so to query records and render the page to the browser.
On the Results page you can click on a Detail link to view the details of a record. Clicking the browser back button from the Detail page causes the Result page to re query the data. How can I tell it to use the browser cache to display the Result page again instead of having to requery?
|
|
|
|
|
One easy method would be to store the data in session (this will work for a data table or data set) then bind it to the grid. Check to see if the data exists in page load and bind it. Then you don't have to requery the data.
Normally, I would think the back button would cause the page to reload. But I guess it is.
I didn't get any requirements for the signature
|
|
|
|
|
In some cases 10,000 or more records will be in the result. If I use a session variable to store the result datatable would that be potential resource hug on the webserver?
|
|
|
|
|
That depends.
If you have a master page and or base page then when any page other than the detail loads, you can clear session to make sure it is gone in the page load in only one place.
If you do not have a master page or a base page then removing the item from session might be a bit tricky.
If you have 1-5 users at a time you should be OK.
How much you can store in session depends on your IIS settings, hardware and number of users. You can have multiple aspnet worker process and the amount of ram each process can use is configurable.
One easy check would be to open the task manager and go to the processes tab (show from all users) check the w3wp.exe process(es) and see how much ram they are consuming.
I didn't get any requirements for the signature
|
|
|
|
|
Thanks, I will try your suggestions.
|
|
|
|
|
Did you try page level caching
|
|
|
|
|
Hi,
I have written the following function in external JScript.js file.
function validateParameter(textBoxId)
{
var paramname = document.getElementById(textBoxId);
alert(paramname);
}
<asp:button id="btnSaveCom" onclick="btnSaveCom_Click" runat="server" xmlns:asp="#unknown">
Text="Save Comments"
OnClientClick="javascript: return validateParameter('<%=txtParam.ClientID %>');">
But during the runtime it showing the alert message as null.
How to pass the input parameter to the function which in external javascript file.
Tnks in advance!
|
|
|
|
|
Can you try adding the javascript in your code behind? OnPageLoad do
btnSaveCom.attributes.add("onclick", return validateParameter('" + txtParam.ClientID + "');");
If you need to. You can create a second javascript method right in your aspx page.
for example
callValidator(clientId)
{
var paramname = document.getElementById(clientId);
validateParameterWithParamInsteadOfId(paramname);
}
I didn't get any requirements for the signature
|
|
|
|
|
As Todd suggests use code behind
btnSaveCom.OnClientClick = string.Format("validateParameter('{0}')", txtParam.ClientID);
led mike
|
|
|
|
|
use
btnSaveCom.Attributes.Add("OnClick","javascript:return xx('" + btnxx.ClientID + "');");
in the code area.
But you cant alert the parname as its an object. write
alert(paramname).value instead.
Abhishek Sur
|
|
|
|
|
Hi, I know how to make whole site in Secured HTTP (https). but I want to know how I can have only one page as https:// and all other pages of that site is in http:// ????
Like, in any shopping site, all product display pages should be in http:// which is faster but payment gatway page must be in https:// which ensures security.
please help.
Thanks for any help.
Anand Desai
Developer
Atharva Infotech
|
|
|
|
|
I don't know if you can do that. Just make a separate web. Any information you need passed between the to can be put in the database or sent via query string. If you do find out how to do this I would be interested in the solution.
I didn't get any requirements for the signature
|
|
|
|