Refresh expicitly my page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • satiss7pwr
    New Member
    • Jan 2010
    • 41

    Refresh expicitly my page

    hi,i am have wbapplication in wich there so many web pages.My problem is that when i do a changes to a page and run the application and go to that page i have to refresh that page expicitly,every time i have to refresh that page.And also i got the value of previos data on that page ,i got the new data when i refresh the page.
    i hope u all understand what i want to say.
    thanks in advance
  • sanjib65
    New Member
    • Nov 2009
    • 102

    #2
    Suppose you made a change in your application, say in the Default.aspx you add a button and put some code in the code behind, in that case if you closed the IE before the change, you don't have to refresh page. You'd open up the IE nd get the changed-page.
    But if you did the change in your application opening up IE, then you have to refresh the page to get the current page. There is nothing abnormality.

    Comment

    • satiss7pwr
      New Member
      • Jan 2010
      • 41

      #3
      this is page that i have to refresh all time .i m fill text box from database value
      Code:
       protected void Page_Load(object sender, EventArgs e)
          {
      
              if (!IsPostBack)
              {
                  OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\\PMDS\\App_Data\\Doc_App.mdb;");
                  OleDbCommand cmd = new OleDbCommand("Select Member_ID,Member_Name,Email_ID from Member_Master where Member_ID=" + Session["mid"] + " ", con);
                  OleDbDataReader dr;
                  con.Open();
                  dr = cmd.ExecuteReader();
      
                  while (dr.Read())
                  {
                      
                      txtmid.Text = dr.GetInt32(0).ToString();
                      txtmname.Text = dr.GetString(1);
                      eid.Text = dr.GetString(2);
                  }
                  //Response.Redirect("AllProject.aspx");
                  con.Close();
              }
      
          }
      Last edited by Frinavale; Jan 25 '10, 03:16 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        I'm really not sure what your problem is...so I'll just give you a generic answer to what I think you're talking about.

        Browsers (Internet Explorer, FireFox, Chrome, Safari, etc) cache web page. If you do not specify that the page should be refreshed then it will display the cached version of the web page.

        You can change the settings in your browser so that they don't cache pages like this. This is a useful setting especially while developing/testing when there are many changes being made to your server code.

        What I don't understand is why your page is still cached when you "run the application". It shouldn't be....but then again I'm not entirely sure what your problem is.

        Could you please try to explain the problem again...maybe list some steps that you are doing that cause the problem.

        -Frinny

        Comment

        • sanjib65
          New Member
          • Nov 2009
          • 102

          #5
          Please try
          Code:
          protected void Page_Load(object sender, EventArgs e) 
              { 
            
                  if (IsPostBack) 
                  {
          instead of

          Code:
          protected void Page_Load(object sender, EventArgs e) 
              { 
            
                  if (!IsPostBack) 
                  {
          I hope your problem will be solved.

          Comment

          Working...