Click here to Skip to main content
15,926,507 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: next 10 records? Pin
pphillips9910-Sep-06 16:38
pphillips9910-Sep-06 16:38 
GeneralRe: next 10 records? Pin
matsnas10-Sep-06 21:07
matsnas10-Sep-06 21:07 
GeneralRe: next 10 records? Pin
Amit Kumar G11-Sep-06 8:57
Amit Kumar G11-Sep-06 8:57 
GeneralRe: next 10 records? Pin
matsnas11-Sep-06 14:48
matsnas11-Sep-06 14:48 
Questioninvalid reportpath? Pin
honeyman_can9-Sep-06 22:49
honeyman_can9-Sep-06 22:49 
QuestionAdd new record Pin
Socheat.Net9-Sep-06 17:35
Socheat.Net9-Sep-06 17:35 
AnswerRe: Add new record Pin
postmaster@programmingknowledge.com9-Sep-06 17:44
postmaster@programmingknowledge.com9-Sep-06 17:44 
QuestionWhat is wrong with this code? Pin
Kasic Slobodan9-Sep-06 16:39
Kasic Slobodan9-Sep-06 16:39 
Let me explain.
GetExcludeFolder() - Gets from XML folders that has to be excluded, that's ok.
To enable paging, first I have to fill the array and then display the data from an array as I did in foreach.

The problem code is if statesment.
It says if s.Name doesen't have any string that GetExcludeFolder() returns, then fill the array with this folder name otherwise dont fill array.

When I run this, I get all folder from wwwroot.
Iam confused, what Iam doing wrong?

protected override void Render(HtmlTextWriter writer)
{
    int i = 0, j = 0;
    DirectoryInfo dir = new DirectoryInfo(@"f:\inetpub\wwwroot\");
    DirectoryInfo[] d = dir.GetDirectories("*");

    foreach (DirectoryInfo s in d)
    {
        if (s.Name.IndexOf(GetExcludeFolder()) == -1) // folder filter
        {
            directory[i, j] = s.Name.ToString();
            directory[i, j + 1] = s.CreationTime.ToString();
            i++;
        }
    }

        Response.Write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" width=\"100%\">");
            Response.Write("<tr>");
                Response.Write("<td style=\"height: 25px; width: 50%;\">Folder name");
                Response.Write("</td>");
                Response.Write("<td style=\"height: 25px; width: 50%;\">Date created");
                Response.Write("</td>");
            Response.Write("</tr>");

            j = 0;
            for (i = currentPage * pageSize - pageSize; i < currentPage * pageSize; i++ )
            {
                Response.Write("<tr>");
                Response.Write("<td style=\"height: 25px;\"><a href=\"http://localhost/" + directory[i, j] + "/\">" + directory[i,j]); // folder name
                Response.Write("</a></td>");
                Response.Write("<td style=\"height: 25px;\">" + directory[i,j + 1]); // creation date
                Response.Write("</td>");
                Response.Write("</tr>");
            }
            Response.Write("<tr>");
                Response.Write("<td style=\"height: 25px\" colspan=\"2\">");

                Response.Write("1 2 3");

                Response.Write("</td>");
            Response.Write("</tr>");
        Response.Write("</table>");

    //base.Render(writer);
}

AnswerRe: What is wrong with this code? Pin
Guffa9-Sep-06 23:10
Guffa9-Sep-06 23:10 
GeneralRe: What is wrong with this code? Pin
Kasic Slobodan10-Sep-06 2:20
Kasic Slobodan10-Sep-06 2:20 
GeneralRe: What is wrong with this code? Pin
Guffa10-Sep-06 2:31
Guffa10-Sep-06 2:31 
GeneralRe: What is wrong with this code? Pin
Dominic Pettifer10-Sep-06 2:37
Dominic Pettifer10-Sep-06 2:37 
GeneralRe: What is wrong with this code? Pin
Dominic Pettifer10-Sep-06 2:49
Dominic Pettifer10-Sep-06 2:49 
GeneralRe: What is wrong with this code? Pin
Kasic Slobodan10-Sep-06 4:13
Kasic Slobodan10-Sep-06 4:13 
GeneralRe: What is wrong with this code? Pin
Dominic Pettifer10-Sep-06 4:39
Dominic Pettifer10-Sep-06 4:39 
GeneralRe: What is wrong with this code? Pin
Guffa10-Sep-06 6:25
Guffa10-Sep-06 6:25 
GeneralRe: What is wrong with this code? Pin
Kasic Slobodan10-Sep-06 7:38
Kasic Slobodan10-Sep-06 7:38 
QuestionASP.NET uploading images Pin
Solly749-Sep-06 16:34
Solly749-Sep-06 16:34 
AnswerRe: ASP.NET uploading images Pin
postmaster@programmingknowledge.com9-Sep-06 17:47
postmaster@programmingknowledge.com9-Sep-06 17:47 
AnswerRe: ASP.NET uploading images Pin
Britney S. Morales11-Sep-06 12:18
Britney S. Morales11-Sep-06 12:18 
QuestionAsp.net 2.0 + javascript ...please help Pin
deepaks39-Sep-06 11:47
deepaks39-Sep-06 11:47 
AnswerRe: Asp.net 2.0 + javascript ...please help Pin
Guffa9-Sep-06 12:17
Guffa9-Sep-06 12:17 
Questionproblem regrading IIS(ASP.Net) Pin
Mystic_9-Sep-06 11:13
Mystic_9-Sep-06 11:13 
AnswerRe: problem regrading IIS(ASP.Net) Pin
minhpc_bk10-Sep-06 20:02
minhpc_bk10-Sep-06 20:02 
Questionadding report in report viewer? Pin
honeyman_can9-Sep-06 9:59
honeyman_can9-Sep-06 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.