|
Hi All,
I have lost lot of time figuring this out.
Scenario - I have to upload an Excel file using File Upload and read the contents and insert some of the excel values in to DB.Using Asp.net and c#
Problem - Works in local machine ,but not in server. Because the server tries to read the same path as the file which was loaded in client machine and file exists in client machine only.
Limitations - Can't write or copy excel file to server.
Can any one help please.
thanking all for your help.
Cheers
Raj
|
|
|
|
|
RajiniUK wrote: Problem - Works in local machine ,but not in server. Because the server tries to read the same path as the file which was loaded in client machine and file exists in client machine only.
This because File is not getting uploaded into server.
When you run any asp.net web application from VS, it handled by VS integrated ASP.NET Engine . Which having all kind of right to store file. But when you upload the sites on server ( IIS ), its runs on default Application Pool . The default Identity of this pool is Network Service , which is having the minimum rigts to access the sites and does not have the write permission to save file on disk.
You can have two different solution,
1) Create different application pool with Local System Identity , which having write access on server and asign it to your web virtual directory.
2) Give the Write Access permission to all the user for that particular folder where you uploading the file.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hey believe me, just dont ever look at the Filepath that comes with Fileupload control.
Just use
fileupload.SaveAs(Server.MapPath(Path.Combine("\folder" + fileupload.FilePath)))
Also the folder needs access permission to asp.net if not placed within virtual directory. Also remove the readonly attribute from the folder.
|
|
|
|
|
I have a link button which is created dynamically in grid.
grid ItemCommand event not firing when I click the link button in the grid.
|
|
|
|
|
divyas1985 wrote: grid ItemCommand event not firing when I click the link button in the grid.
We can not guess without looking at the code.
Can you provide us with some more details.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
divyas1985 wrote: I have a link button which is created dynamically in grid.
Is it a dynamic control or Template Field ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
How to handle the full screen view. I wnat my page to be auto adjusted when the user presses the F11 button.
regards,
Suresh
|
|
|
|
|
<pre>
<asp:TemplateField ShowHeader="False">
<itemtemplate>
<asp:LinkButton id="linkBtnSurrender" runat="server" Text="Surrender" CommandName="Surrender" onclientclick="confirmation()" value = "Surrender" CommandArgument='<%#Eval("SOVehicle.SOVehicleId") %>' ></asp:LinkButton>
<%----%>
</itemtemplate>
</asp:TemplateField>
</pre>
Is it possible to popup in javascript everytime this link button is clicked to confirm surrender yes no?
I am using command argument to pass the id of vehicle to be surrendered. the javascript functions pops up but irrespective of yes no the vehicle gets surrendered.
|
|
|
|
|
Your code is not readable, please post it with proper format.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
<pre>
<asp:TemplateField ShowHeader="False">
<itemtemplate>
<asp:LinkButton id="linkBtnSurrender" runat="server" Text="Surrender" CommandName="Surrender" onclientclick="confirmation()" value = "Surrender" CommandArgument='<%#Eval("SOVehicle.SOVehicleId") %>' ></asp:LinkButton>
</itemtemplate>
</asp:TemplateField>
</pre>
Is it possible to popup in javascript everytime this link button is clicked to confirm surrender yes no?
I am using command argument to pass the id of vehicle to be surrendered. the javascript functions pops up but irrespective of yes no the vehicle gets surrendered.
|
|
|
|
|
I had created dynamic control using following code
TextBox txt = new TextBox();
txt.ID = ("txt1" + index);
txt.Text = "amit";
PlaceHolder1.Controls.Add(txt);
this.Page.Form.Controls.Add(PlaceHolder1);
This way i am able to add but facing proble to read the id of a control while reading
Thanks,
amitPatel
|
|
|
|
|
|
this sh*t error appears to me at the adapter.update(~) method
even i did the issue many times and it worked
what should i do !!
|
|
|
|
|
Hi All,
I am having web page containing table element in this table i am having 5-6 rows
based on some condition i am hiding and showing some of the rows using javascript,this functionality is working fine but the Tab order of controls get diturbed when some rows gets hide, Tab order is working fine when all rows are visible.
Can any one look into this issue?
|
|
|
|
|
hi how we create popmenu by html and javascript,plz help me????????
|
|
|
|
|
You can use Ajax, thats if your using asp.
|
|
|
|
|
I want to make a button which should be enable only once in 24hrs...................how it will be possible..........plz guide me a bit............
|
|
|
|
|
|
use javascript...
SetInterval("enableBtn()", 1000);
function enableBtn()
{
var current = new Date();
var start = "1:00 PM";
var constant= new Date("1/1/2007 " + start);
diff = current - constant;
if (diff < 0)
{
var btn = document.getElementById("btn");
btn.disabled = false;
}
}
Hope this helps.
|
|
|
|
|
You are going to expect users to keep a webpage open for 24 hours at a time? YOu don't need any AJAX or JavaScript, just enable/disable the button when the page is rendered.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: You are going to expect users to keep a webpage open for 24 hours at a time?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
KhandelwalA wrote: I want to make a button which should be enable only once in 24hrs.
How u said 24 hrs?From users point of view?
I don't think that its a good idea.As Mark said a user can't keep a page open for 24 hrs.
|
|
|
|
|
Why would you do that?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i'm working on a layered arch. website
in the BLL the BLL classes can't see the table adapters of the XSD
why ????
also i can't import the dataset table adapters
and by the way the same code works perfectly on another computer !!!!!!!!!!!!!!!
help plz
|
|
|
|
|
You cant access the XSD.. Is it excluded?
EmZan wrote: the same code works perfectly on another computer
this is weird.
Check if something is missing..
|
|
|
|