|
|
Sandeep Akhare wrote: Every one does not make research just they read it from anyother website/books and share it .
May be.
But at least he can post the link instead of copying it here. I feel this is not sharing, simply learning how to copy content. You can see in his post one figure name has referred. If CP allows image uploading, he would have copied that too. So it is copied without reading fully.
[edit]
Original post has been deleted by him
[/edit]
|
|
|
|
|
Thats true
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... "
|
|
|
|
|
Hello,
first note that this code concerns .net framework 1.1.
I'm having trouble with the following: I have a class derived from Page. In
the Page_Load of this class I'd like to do the following:
HtmlForm form = new HtmlForm();
form.Name = "test";
form.ID = form.Name;
form.Controls.Add(_header);
using LoadControl(...)
form.Controls.Add(_menu);
...
for(int i = 0; i < Page.Controls.Count; i++)
{
form.Controls.Add(Page.Controls[i]);
}
form.Controls.Add(_footer);
Page.Controls.Clear();
Page.Controls.Add(form);
What I'd like to achive is to have a base page with a couple of controls on,
from which i can derive further.
The problem I'm having is, that on each round in the for loop, when I "read"
the Page.Control at the given index, the Page.Controls.Count decreases by
one.
Could somebody please shed some light. Thanks in advance!
Greetings from Berlin,
Matthias
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
matthias s. wrote: The problem I'm having is, that on each round in the for loop, when I "read"
the Page.Control at the given index, the Page.Controls.Count decreases by
one.
Hearing such a problem first time. Try assigning the page count to a variable before starting the loop. ?
Seeing your base class design, I got confused. Why you need add the header like this ? if you know header should be there in all pages, why don't you add this in the design time itself ?
[edit]
One more point, I don't think ASP.NET can maintain viewstate for the dynamic controls added on page_load, because viewstate would be already loaded before page_load fires.
[/edit]
|
|
|
|
|
Hi..
Friends..
When I delete file with C# code, I m getting error like
"Access to the path 'g:\activewebroot\Active24\w11618838\web\content\File\xxx.zip' is denied."
But I can upload new files on server, But I cant delete this files !!
I dont know, Why this problem occurred ??
Please, Give me any solution ASAP.
Thanks in Advance.
Regards,
Abhi
|
|
|
|
|
Might be the file is open or in use close that file before trying delete that file
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... "
|
|
|
|
|
No, Sandeep !!
Not any files are open on the server.
In my project, I have a admin panel..
With this, I m uploading file, and it uploads successfully...
And Then, I m listing all files name and with button 'delete' for each file !!
But when, I click on 'delete' button , I am deleting files from server by C# code..Then I got this error !!
Regards,
Abhi
|
|
|
|
|
Sorry i gave wrong reply but yo should have read/write/delete permision for that path to asp.net process
Do one thing give all permision to Everyone then try if it delete the file then go specific
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... "
|
|
|
|
|
-- Abhi -- wrote: When I delete file with C# code, I m getting error like
"Access to the path 'g:\activewebroot\Active24\w11618838\web\content\File\xxx.zip' is denied."
How you are giving file name ? ASP.NET will be having delete permissions only in the website, Not in all hard disk locations. When referring a path in ASP.NET always use Server.MapPath() to get files physical location on the server.
|
|
|
|
|
No, Navneeth !!
Not any files are open on the server.
In my project, I have a admin panel..
With this, I m uploading file, and it uploads successfully...
And Then, I m listing all files name and with button 'delete' for each file !!
But when, I click on 'delete' button , I am deleting files from server by C# code..Then I got this error !!
Regards,
Abhi
Regards,
Abhi
|
|
|
|
|
-- 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
|
|
|
|