Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6761885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:14:41+00:00 2026-05-26T14:14:41+00:00

I have a web project in asp.net in which i have dashboard on which

  • 0

I have a web project in asp.net in which i have dashboard on which there are dropdownlists with previous seven dates and when i select the date from dropdownlist it opens the file from folder matching with date selected.My dropdownlists are arranged vertically.A strange problem is that when i select the date from ist dropdownlist it opens the file fine and when i select the date date value from any other dropdownlist it opens the same file which opened from the ist dropdownlist all remaining dropdowlists behave same like.And other strange Problem is that when i start opening files from the last dropdownlist to ist.when i select the date from last dropdown ot opens the file fine and also when select the date from 2nd last it opens the file fine and all are open the files fine i-e when i start Ist to last it shows problem but when i start last to Ist it works fine.Please tell me what possibility can be?
My code is bellow

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.IO
Imports System.Data.SqlClient
Imports System.Diagnostics.Process
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Console


Partial Class DashBoard
    Inherits System.Web.UI.Page

    Protected Sub DD1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD1.SelectedIndexChanged
        Response.Redirect("Reports/Daily Production and Stock Report (Crescent Ujala)/Daily Production and Stock Report (Crescent Ujala) " & DD1.SelectedValue & ".xls", True)
    End Sub
    Protected Sub DD2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD2.SelectedIndexChanged
        Response.Redirect("Reports/Daily Production Efficiency Report (Crescent Ujala)/Daily Production Efficiency Report (Crescent Ujala) " & DD2.SelectedItem.Value.ToString & ".pdf", True)
    End Sub
    Protected Sub DD3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD3.SelectedIndexChanged
        Response.Redirect("Reports/September Sowing Report/September Sowing Report " & DD3.SelectedItem.Value.ToString & ".ods", True)
    End Sub
    Protected Sub DD4_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD4.SelectedIndexChanged
        Response.Redirect("Reports/September Sowing Report Area-1/September Sowing Report Area-1 " & DD4.SelectedItem.Value.ToString & ".ods", True)
    End Sub
    Protected Sub DD5_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dd5.SelectedIndexChanged
        Response.Redirect("Reports/September Sowing Report Area-2/September Sowing Report Area-2 " & dd5.SelectedItem.Value.ToString & ".ods", True)
    End Sub
    Protected Sub DD6_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD6.SelectedIndexChanged
        Response.Redirect("Reports/Daily P & L Cost sheet/Daily P & L Cost sheet. " & DD6.SelectedValue & ".xls", True)
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Me.IsPostBack Then
            'Add Values to Dropdownlist 1
            DD1.Items.Add(New ListItem("", ""))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -1, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -1, Now), "yyyy.MM.dd")))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -2, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -2, Now), "yyyy.MM.dd")))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -3, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -3, Now), "yyyy.MM.dd")))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -4, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -4, Now), "yyyy.MM.dd")))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -5, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -5, Now), "yyyy.MM.dd")))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -6, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -6, Now), "yyyy.MM.dd")))
            DD1.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -7, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -7, Now), "yyyy.MM.dd")))

            'Add Values to Dropdownlist 2

            DD2.Items.Add(New ListItem("", ""))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -1, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -1, Now), "yyyy.MM.dd")))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -2, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -2, Now), "yyyy.MM.dd")))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -3, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -3, Now), "yyyy.MM.dd")))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -4, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -4, Now), "yyyy.MM.dd")))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -5, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -5, Now), "yyyy.MM.dd")))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -6, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -6, Now), "yyyy.MM.dd")))
            DD2.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -7, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -7, Now), "yyyy.MM.dd")))

            'Add Values to Dropdownlist 3

            DD3.Items.Add(New ListItem("", ""))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -1, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -1, Now), "yyyy.MM.dd")))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -2, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -2, Now), "yyyy.MM.dd")))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -3, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -3, Now), "yyyy.MM.dd")))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -4, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -4, Now), "yyyy.MM.dd")))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -5, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -5, Now), "yyyy.MM.dd")))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -6, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -6, Now), "yyyy.MM.dd")))
            DD3.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -7, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -7, Now), "yyyy.MM.dd")))

            'Add Values to Dropdownlist 4
            DD4.Items.Add(New ListItem("", ""))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -1, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -1, Now), "yyyy.MM.dd")))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -2, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -2, Now), "yyyy.MM.dd")))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -3, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -3, Now), "yyyy.MM.dd")))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -4, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -4, Now), "yyyy.MM.dd")))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -5, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -5, Now), "yyyy.MM.dd")))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -6, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -6, Now), "yyyy.MM.dd")))
            DD4.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -7, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -7, Now), "yyyy.MM.dd")))

            'Add Values to Dropdownlist 5

            dd5.Items.Add(New ListItem("", ""))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -1, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -1, Now), "yyyy.MM.dd")))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -2, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -2, Now), "yyyy.MM.dd")))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -3, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -3, Now), "yyyy.MM.dd")))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -4, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -4, Now), "yyyy.MM.dd")))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -5, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -5, Now), "yyyy.MM.dd")))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -6, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -6, Now), "yyyy.MM.dd")))
            dd5.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -7, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -7, Now), "yyyy.MM.dd")))

            'Add Values to Dropdownlist 6

            DD6.Items.Add(New ListItem("", ""))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -1, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -1, Now), "yyyy.MM.dd")))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -2, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -2, Now), "yyyy.MM.dd")))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -3, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -3, Now), "yyyy.MM.dd")))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -4, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -4, Now), "yyyy.MM.dd")))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -5, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -5, Now), "yyyy.MM.dd")))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -6, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -6, Now), "yyyy.MM.dd")))
            DD6.Items.Add(New ListItem(Format(DateAdd(DateInterval.Day, -7, Now), "dd-MMM"), Format(DateAdd(DateInterval.Day, -7, Now), "yyyy.MM.dd")))
        End If
    End Sub
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:14:42+00:00Added an answer on May 26, 2026 at 2:14 pm

    I believe that in your browser, you are probably getting the prompt for open/save the file. In such case, the current html document (including view-state) will remain as is in the browser. So when next post-back happens due to next drop-down select, ASP.NET will infer that selection has changed for two drop-downs (because view-state belongs to the request to page where no drop-down was selected) and will attempt to raise events for the same. It will probably raise event as per control tree and hence event for first drop-down list will be raised first and that would open the first file. Again, response.redirect would cut-off page processing (and no subsequent events will be processed). That’s why you see the weird behavior – for example, if you select DD4 first then it will open corresponding file, now if you select DD5, it will still open DD4 file. However, now if you select DD2, it will open file for DD2 and again in this state, you tried to open DD3, it will going to open DD2. Any selection in drop-down list is going to open the file for the earliest drop-down selected.

    The remedy is simple – open the file in new window. For example, change all response.redirect lines to something like

    ClientScript.RegisterStartupScript(Me.GetType(), "openfile", _
        "window.open('<put your file url here>');", true)
    

    The better solution is remove auto-postbacks and server side selection events – instead, handle the selection changed in the java-script and launch the file from there.

    Even better solution (IMO) is to change the page UI – instead of using drop-down lists, offer download links (anchor tags) for previous seven dates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large-ish web project which is migrating from classic ASP to ASP.NET
I have an ASP.NET project which has already some custom fields in it's web.config
I have built a web setup project in VS2008 which installs my ASP.NET/Silverlight app
I have an ASP.NET web application project which references another project called ModusCore (or
I have a project (Web Application) which I have been developing in C#/ASP.NET, and
I have an asp.net web project which uses a SqlProfileProvider for membership structure,i am
I dealing with the next problem, I have a asp.net web project in which
I'm working on a Web project using Asp.Net MVC, which I'll have to deploy
I have an ASP.NET web site project, which I'm publishing to IIS on my
I have a Silverlight project (with ASP.net MVC web project) Suddenly, when I press

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.