|
use hidden controls or viswstate or session!
studing is processing in this life.
|
|
|
|
|
This page refresh meaning it have posted to server.You just this button of print run at client,not server,just validation controls using-occur in client.
studing is processing in this life.
|
|
|
|
|
i use following code to create a folder (.net 1.1)
if ( Directory.Exists(Server.MapPath("~/temp") +"/"+ SID) )
{
lbl_event.Text=ss;
Directory.Delete( Server.MapPath("~/temp") +"/"+ SID, true );
}
Directory.CreateDirectory(Server.MapPath("~/temp") +"/"+ SID );
and following error appear "Could not find a part of the path "D:\"."
you can see the error with its details http://kmrt.ir/Welcome.aspx[^]
it is not for permission!
anyone know how could i solve it?!!
please help me
|
|
|
|
|
Nafiseh Salmani wrote: Server.MapPath("~/temp") +"/"+ SID
What kind of system are you using? That would work on a *nix system, as that uses "/" as file path separator, but it would not work on a Windows system, as that uses "\" as file path separator.
You should use the Path.Combine method to form the path, that way it will work regardlesss of what file path separator the system uses:
Path.Combine(Server.MapPath("~/temp"), SID)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i checked
Server.MapPath("~/temp") +"/"+ SID . it works .
just when i use
Directory.Delete or
Directory.CreateDirectory it takes Error.
i set the permission also!
How could I solve it?
|
|
|
|
|
Nafiseh Salmani wrote: i checked
Server.MapPath("~/temp") +"/"+ SID
. it works .
In what sense do you mean that it works?
If you are using it as a path in a Windows system, it's not correct. It might work eventhough in some situations, but fail in others.
Nafiseh Salmani wrote: How could I solve it?
Eh? I already told you. Gave you the code for it and everything.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Did you consider using the debugger to see what the path is it's trying to write to ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I cant use it! because it happen when i upload it not at localhost
|
|
|
|
|
Then write a page which works out the path and writes it to the page, so you can see what you're dealing with.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
You had better debug it,or create a new file to debug filepath validation.Certainly,you also use following:
Directory.Delete(Server.MapPath(@"./temp")+"//"+sid,true);
or
Directory.Delete(Server.MapPath(".//temp")+"//"+sid,true);
Ple notice "/" in limit!
studing is processing in this life.
|
|
|
|
|
Hi,
i would saving a int in variable, When there is the post of variable, I want this record remains variable in the page despite updating the page, I do as follows:
public string s;
protected void Page_Load(object sender, EventArgs e)
{ if (Request.Form["champ"] != "")
{ s = Request.Form["champ"]; }
ViewState["s"] = s;
string s1 = ViewState["s"].ToString();
}
an error was shows : The reference object is not defined by an instance of an object , on line : string s1 = ViewState["s"].ToString();
Please help me to resolve this great problem, thank you very mutch.
|
|
|
|
|
Set it as a hiddenfield server control.
|
|
|
|
|
string s1=(string)ViewState["s"];
studing is processing in this life.
|
|
|
|
|
<ajaxtoolkit:tabpanel runat="server" width="650px" id="pnlDocuments" xmlns:ajaxtoolkit="#unknown">
<contenttemplate>
<asp:updatepanel id="upnlDocuments" runat="server" xmlns:asp="#unknown">
<contenttemplate>
//THIS IS WHERE I WANT TO DOWNLOAD FILE FROM THE SERVER SAY NOTE.TXT OR EMP.DOC BUT I CANNOT
<asp:linkbutton id="lnkViewEmpDoc" runat="server" width="161px" onclick="lnkViewEmpDoc_Click">View Documents
<triggers><asp:postbacktrigger controlid="Submit_Document">
<headertemplate>
Documents
|
|
|
|
|
What is it you are trying to do?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
TRYING TO DOWNLOAD THE FILE FROM THE SERVER TO THE CLIENT
|
|
|
|
|
Again, don't shout using all caps. That is rather rude. You should try describing a bit more in detail what you are trying to accomplish instead of just throwing a few lines of code up there.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
MAYBE THE POSTING WAS NOT THAT CLEAR
|
|
|
|
|
Don't shout.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Sorry if my typing in caps locked pissed you off....
I have the following code
<ajaxtoolkit:tabpanel runat="server" width="650px" id="pnlDocuments" xmlns:ajaxtoolkit="#unknown">
<contenttemplate>
<asp:updatepanel id="upnlDocuments" runat="server" xmlns:asp="#unknown">
<contenttemplate>
//Upload the file into the server is successful using above code
<asp:linkbutton id="lnkViewEmpDoc" runat="server" onclick="lnkViewEmpDoc_Click">View Documents
//But downloading it using the above link button "View Documents" is unsuccessfull,rather i got now idea how to do it.
<triggers><asp:postbacktrigger controlid="Submit_Document">
<headertemplate>
Documents
|
|
|
|
|
summon_19 wrote: Sorry if my typing in caps locked pissed you off....
It's cool, man.
Just so you know, it's easier to look at code in a post if you use the code block button down by the smileys, and also to check off the Ignore HTML tags in this message check box
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
summon_19 wrote: önclick="lnkViewEmpDoc_Click"
Is it getting triggered at all?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
I'm creating a website where users can send mail messages to each other through the website (they don't see the email address of the receiver)
From the documentation of the SmtpClient class:
If there is an e-mail transmission in progress and you call SendAsync or Send again, you will receive an InvalidOperationException.
That doesn't sound very good
I assume that I have to create a queue class for sending messages because users can be sending messages at the same time (which means many threads calling SmtpClient.Send() at the same time), is this correct? I have another issue too, I noticed that when I send mail from my local machine, some messages are delivered but the majority are not, and even those messages that were successfully delivered, many of them took way too long to be delivered, up to many days with some of them!! I know that there must be something wrong, but I have no idea what, I have checked everything on my computer but everything seemed ok (I checked the SMTP settings, esp. the relay settings, and they were OK. I also checked the settings of the anti-virus software and found it wasn't blocking the outbound SMTP messages), I'm worried it might cause problems later on the production server. Is there any way to get notified of the delivery of messages, I save the messages to a database when the user clicks the Send button, now I want a reliable way of knowing whether the message was delivered or not (I have a field in the database that I use as a flag, I want to set it to true when the message is sent so that I can know what was sent and what wasn't in order to try to send it again), can this be done with the mail classes in the .net framework or do I need some component that's more reliable? If so, do you have any suggestions for a good component? (preferably something you have personal experience with).
Sorry for my long post, but I want to mention one last thing. As far as I understand, and please correct me if I'm wrong, SmtpClient.Send() only delivers the messages to the SMTP server and that's it, so if the messages are delivered to the SMTP server and not sent after that there's no way to find out, is this correct?
Thank you for taking the time to read my post, any suggestions are very much appreciated ..
|
|
|
|
|
Oh, by the way, I'm aware of DeliveryNotificationOptions but it's not what I'm looking for, I want to get a notification (not an email) that I can use to update the flag in my database. Well, it seems that it's not possible but would anybody confirm that? Thanks.
|
|
|
|