|
-- Abhi -- wrote: But when, I click on 'delete' button , I am deleting files from server by C# code..Then I got this error !!
Well, can you post that deletion code here ?
|
|
|
|
|
Yes. Sure.
System.IO.FileInfo objFileInfo = new System.IO.FileInfo(Server.MapPath("../File/") + Filename.ToString());
System.Security.Permissions.FileIOPermission fp = new System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.AllAccess, objFileInfo.Directory.FullName);
objFileInfo.Delete();
Regards,
Abhi
|
|
|
|
|
-- Abhi -- wrote: Server.MapPath("../File/") + Filename.ToString()
Have you printed out put of this line ? Are you getting a valid file path ?
-- Abhi -- wrote: System.Security.Permissions.FileIOPermission fp = new System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.AllAccess, objFileInfo.Directory.FullName);
objFileInfo.Delete();
Why all these ? Simply call File.Delete(Path)
|
|
|
|
|
Yes...
This path works best in my Local project in my machine.
But after uploading this project DLL to the server by FTP...
Then I got error.
I have used below code :
System.Security.Permissions.FileIOPermission fp = new System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.AllAccess, objFileInfo.Directory.FullName);
But, I cant find solution with above permission code, this code is meaning less.
Regards,
Abhi
|
|
|
|
|
If you r writing this code in asp.net, so due to security reason this will not done, u have to use impersonation or check authentication mode.
Muhammad Rashid
|
|
|
|
|
what's the difference between
databinder.eval(container.dataitem,"columnname")
and
eval("columnname")
Soniagupta1@yahoo.co.in
|
|
|
|
|
Sonia Gupta wrote: databinder.eval(container.dataitem,"columnname")
Converts DataItem object to the specified value.
Sonia Gupta wrote: eval("columnname")
Is this valid ?
|
|
|
|
|
First one is Ok.
Converts DataItem object to the specified value.
Second One is not valid
SSK.
|
|
|
|
|
The second one can be used only in context databinding expression ( <%# .. >), but that's it. It's ASP.NET sugar, nothing else. Under the hood, ASP.NET will generate exactly the same code. See this excellent blog post[^] for more details.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Second one is also valid method. I used this methods many times in my application.
Check out Eval
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
Hi Imran,
What you have said is Ok But the code should be like this:
<%# Eval("url") %><br />
<br />
SSK.
|
|
|
|
|
wHAT ABOUT databinder.eval(container.dataitem,"columnname")
iT ALSO SHOULD BE LIKE <%# databinder.eval(container.dataitem,"columnname") %>
---------------------------------------------------
|
|
|
|
|
|
agar mota mota samjhana ho to kya matlab hai ?
What's the basic difference ?
Soniagupta1@yahoo.co.in
|
|
|
|
|
I dont know the difference between them. I just wanted to prove that the Second Method is also VALID.
GOOGLE IS OUR BEST FRIEND TO PAHELE TUM WAHA KOSHISH KARO.
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: GOOGLE IS OUR BEST FRIEND TO PAHELE TUM WAHA KOSHISH KARO.
Pls be in English so that all of them can Understand.
SSK.
|
|
|
|
|
Sonia Gupta wrote: agar mota mota samjhana ho to kya matlab hai ?
What????????
SSK.
|
|
|
|
|
hi friend i am adding uccp dll(Com based dll) in my web application
but error occur when i new (Dim _mUccp As New UCCPLib.UccPlatform()) this dll.
error:-
Retrieving the COM class factory for component with CLSID {E0AA501C-CAD6-4D93-A5A7-DAF1C0B30F32} failed due to the following error: 80070005.
any body have solution of this problem then help me.
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
Hi All,
I have created a ASP.NET WebApplication .Is it used to upload files.
Sometimes We have to upload 30MB files using my WebApplication.BUT I am getting errors like "TimeOut Error " and "Page not found " Errors when uploading files.
So How do I avoid above errors and upload files successfully?
Thanks in Advance.
|
|
|
|
|
For that you need to mae certain changes in web.config
add
<httpRuntime executionTimeout="600" maxRequestLength="409600"/>
in the <system.web>
maxRequestLength in bytes
-- modified at 2:51 Friday 21st September, 2007
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
You need to add some setting to web.config. Check this[^] to get started
|
|
|
|
|
I want validate listbox. Items adding to the listbox should be not greater than 5
How can I do this onblur
Thanks
|
|
|
|
|
Can u please explain in detail what exactly u want say by this:
"Items adding to the listbox should be not greater than 5" ???
|
|
|
|
|
oNCLICK OF BUTTON EVENT , CALL JAVASCRIPT AND PASS NO OF LISTITEMS.
Btn.Attributes.Add("onclick","return chk("+ list.Items.Count +");");<br />
<br />
Function chk(count)<br />
{<br />
if(count>5){alert('Failed');return false;}else{return true;}<br />
}
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
javascript function:
function fun(id)
{
var obj = document.getElementById(id);
var cnt = obj.options.length;
var checked = 0;
for (var i = 0; i < cnt; i++)
{
if (obj.options[i].selected)
checked++;
}
if (checked > 5)
{
alert('more than 5 selection');
obj.focus();
}
}
###################################
Server side:
ListBox1.Attributes.Add("onblur", "fun('" + ListBox1.ClientID+ "');");
|
|
|
|