English 中文(简体)
未返回的复方的 as净下降部分值
原标题:Selected value in asp.net dropdown in a repeater not returned

我现在谈一个非常奇怪的问题。 I m, using an asp.net wizard to upload some file. 这些档案用上载。 在文件上载后,我有一份上载文件清单,储存在会议变量上。 我利用会议变量制作一张显示上载档案的表格。 用户现在可以选择在表格中减少一个档案类别。 当用户点击填写纽顿时,该代码读上表上的档案和类别。 奇怪的是,这部法典在我的开发机器和几个服务器上操作得当,但在某个客户的服务器上,下降值永远无效。 The relevent Code:

protected void Page_Init(object sender, EventArgs e)
    {
            bindRepeater();         
    } 

private void bindRepeater()
    {
        ArrayList sessionFiles = (ArrayList)Session["PLUploadFiles"];

        IList<document> files = new List<document>();

        foreach (string fileName in sessionFiles)
        {
            document doc = new document();

            doc.FileName = fileName;
            doc.Description = fileName.Split( . ).First();

            files.Add(doc);
        }

        TableRepeater.DataSource = files;
        TableRepeater.DataBind();
    }

protected void SaveButton_Click(object sender, EventArgs e)
    {

        foreach (RepeaterItem item in TableRepeater.Items)
        {
            Label descriptionLabel = (Label) item.FindControl("DescriptionLabel");
            String description = descriptionLabel.Text;

            Label fileNameLabel = (Label)item.FindControl("FileNameLabel");
            String fileName = fileNameLabel.Text;

            DropDownList categoryDropDown = (DropDownList) item.FindControl("CategoryDropDownList");
            string category = categoryDropDown.SelectedValue;

            if(SaveClicked != null)
            {
                SaveEventArgs s = new SaveEventArgs();
                s.FileName = fileName;
                s.Category = category;
                s.Description = description;

                SaveClicked(this, s);
            }

        }

        Response.Redirect(RedirectURL);
    }

请注意,整个izar人的生活由用户控制。 没有人想到,该守则为什么在大多数机器上进行罚款,但却在某个服务器上失败?

最佳回答

象我这样认为。 出于某种原因,我看到了双重退步。 这要求我的法典在错误的时代重新确定会议变数。 周围的工作是在上页上重新确定与上载页链接的会议变量,以便在上页装之前重新启用。 我不知道我为什么看到双重退步。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签