This is a migrated thread and some comments may be shown as answers.

Radwindow still opened when i refesh

3 Answers 70 Views
Window
This is a migrated thread and some comments may be shown as answers.
trunghieu
Top achievements
Rank 1
trunghieu asked on 05 Jul 2011, 08:24 PM
Hello,i using Radwindow in itemCommand Event of RadGrid,i have a code
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
      {
          string id= "";
          try
          {
 
               
                  if (e.CommandName == "xem")
                  {
                      id= e.CommandArgument.ToString();
                    
                          RadWindow w = new RadWindow();
                          w.ID = "window";
                          w.VisibleOnPageLoad = true;
                          w.Skin = "Vista";
                          w.Height = 430;
                          w.Width = 600;
                          w.Title = "Thư Từ Ban Quản Trị Siêu Thị BIG C";
                          w.NavigateUrl = "~/noidung.aspx?id=" + id;                          
                          windowmanager.Windows.Clear();
                          windowmanager.Windows.Add(w);                       
        
              }
           
               
          }
          catch (Exception ex)
          {
              lbloi.Text = ex.Message;
          }
      }
i don't know how to say but when i refesh web page,Radwindow still opened although i do not something else
Please Help Me
Thanks,
Trung Hiếu

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 06 Jul 2011, 07:41 AM
Hi Trunghieu,

You need to set EnableViewState to false for the RadWIndowManager that you are using. If this property is set to true, all RadWindows declared in the manager will preserve their server-side properties, including the VisibleOnPageLoad one.


Greetings,
Georgi Tunev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
trunghieu
Top achievements
Rank 1
answered on 06 Jul 2011, 02:05 PM
Thanks,but not run
this's my code
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
      {
          string id= "";
          try
          {
  
                
                  if (e.CommandName == "xem")
                  {
                      id= e.CommandArgument.ToString();
                     
                          RadWindow w = new RadWindow();
                          w.ID = "window";
                          w.VisibleOnPageLoad = true;
                          w.Skin = "Vista";
                          w.Height = 430;
                          w.Width = 600;
                          w.Title = "Thư Từ Ban Quản Trị Siêu Thị BIG C";
                          w.NavigateUrl = "~/noidung.aspx?id=" + id;                         
                          windowmanager.Windows.Clear();
                          windowmanager.Windows.Add(w);                      
                          windowmanager.EnableViewState = false;
              }
            
                
          }
          catch (Exception ex)
          {
              lbloi.Text = ex.Message;
          }
      }
can you help me ? edit my code
Thanks,
Trung Hiếu
0
Princy
Top achievements
Rank 2
answered on 07 Jul 2011, 04:58 AM
Hello Trunghieu,

Take a look at the following forum which discussed the similar issue.
Stop RadWindow from always loading on page postback .

Thanks,
Princy.
Tags
Window
Asked by
trunghieu
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
trunghieu
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or