|
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.
|
|
|
|
|
Hi All,
I m very new in ASP.NET and i m making my first website.
For the header of the site i want to use photoshop cs. My question is, what size schould i use for the header to avoid resolution issues? and how can i import the header inside visual studio 2005?
Thanx.
|
|
|
|
|
NewToAspDotNet wrote: My question is, what size schould i use for the header to avoid resolution issues?
Depends on what you want or is in the project requirements.
NewToAspDotNet wrote: how can i import the header inside visual studio 2005?
You should probably really go and get a book or two on ASP.NET.
"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
|
|
|
|
|
A good suggestion is to pick up a primer book on ASP.Net, probably one the targets the framework your going to use (2.0++).
However, this is not really an ASP.Net specific question, more along the lines of html/css.
Depending on how your site design will be, will dictate how large (wide) your graphic can be. If you're making your site scale to N% screen resolution, you could *safely make your graphic 800px wide and fit into 98% of screen resolutions for modern, non-palm type devices.
A smaller graphic, that bleeds into a background color or gradient is a safer way to go in any event. using % instead of pixels is much more flexible.
To answer the latter part of your question, this depends on how your going to model your site, but still goes back to css/html.
An example of the css might look like this:
#HeadLogo {
background: #ffffff url(images/logo.jpg) left top no-repeat;
width:100%;
height:125px;
}
In the html, you would have a div /layer block that would inherit the css element you defined with the #
< div id='HeaderLogo' >
< /div >
Assuming your graphic is 200x125 it will show up in the left top corner of the div, filling it to the bottom and the rest of the space would be white.
Hope this helps get you going!
|
|
|
|
|
I am new in asp.net.Just other say,you must study html when you start your asp.net2.0.Now i am studing asp.net2.0 with vistual studio 2005.When you will have studied all html and some javascript language,i want you can study asp.net.
ok,i am from China.I hope we can get progress together!
My english is not well,if i don't say clear,Ple excuse me.
|
|
|
|
|
Hi
I am building a website with HTTPHandler that handles requests and returns a "text/html" response to the client, the response might be in any language (English, Spanish, Arabic, Indian, etc.).
The response that I create will be embedded inside web pages hosted by other websites and those websites will be having different encoding schemes for their pages.
my problem is that I don't know how to return a response that is encoded with the same encoding scheme as the web-page that will be embedding the response.
I am doing something like this ( I don't know if there is a better way):
1. I have a HttpHandler that handles ".jpg" requests.
2. A user of www.somewebsite.com creates a new topic in the forum, so he uses the image tag to load my text [img]www.mywebsite.com/file.jpg[/img]
3. My website parses the request BUT instead of returning "image/jpeg" response it returns "text/html" response [Don't know what encoding type to use for it]
4. in the forum topic, instead of an image being displayed it will display my html response which might have different encoding than the web page itself, which is the problem.
any ideas on solving this problem or doing it in a better way?
Thanks
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
Mohammad A Gdeisat wrote: response it returns "text/html" response [Don't know what encoding type to use for it]
It's not encoding, it's content type. Set the content type of response from HTTPHandler to "image/jpeg"
|
|
|
|
|
Hi
as I wrote in the question, although the request is an image request, the response is "text/html" response, I am not sending any image files. The text will display correctly only if the encoding I use in the response matches the encoding of the web-page that receives the html response.
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|