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

Missing Data when using with Master Page

12 Answers 83 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jason Gajewski
Top achievements
Rank 1
Jason Gajewski asked on 30 Jun 2010, 09:49 PM

When binding data to the RadComboBox utilizing an Ajax panel, the RadComboBox loses its datasource when used within a master page.  The RadComboBox is populated on initial load, but after making a selection, it loses the datasource.

My master page markup:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="Management.Web.Site1" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
    <asp:ContentPlaceHolder ID="head" runat="server">  
    </asp:ContentPlaceHolder> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
        </asp:ContentPlaceHolder> 
    </div> 
    </form> 
</body> 
</html> 

My content page markup (WebForm1):

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
    CodeBehind="WebForm1.aspx.cs" Inherits="Management.Web.WebForm1" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" 
    ViewStateMode="Enabled">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
        <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">  
        </telerik:RadComboBox> 
    </telerik:RadAjaxPanel> 
</asp:Content> 

My non-master page markup (WebForm2):

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Management.Web.WebForm2" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
            <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">  
            </telerik:RadComboBox> 
        </telerik:RadAjaxPanel> 
    </div> 
    </form> 
</body> 
</html> 

My code behind (of both the content and non-master pages):

using System;  
using System.Web.UI;  
 
namespace Management.Web  
{  
    public partial class WebForm1 : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
                this.LoadTags();  
        }  
 
        private void LoadTags()  
        {  
            TagManager mgr = new TagManager();  
 
            RadComboBox1.DataSource = mgr.GetAllByModuleId(5);  
            RadComboBox1.DataValueField = "Id";  
            RadComboBox1.DataTextField = "Name";  
            RadComboBox1.DataBind();  
        }  
 
        protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
        {  
 
        }  
    }  

As you can see, the code is VERY basic.  The TagManager is a class that returns the data.

When using the Master Page (WebForm1), you lose the datasource after you make your first selection.  If you attempt to click on the drop down arrow, after making your initial selection, the RadComboBox is empty (doesn't even respond to the click).

When using the non Master Page (WebForm2), the datasource is persisted no matter how many times you make a selection in the RadComboBox.

Any thoughts why there is a difference when using a master page?

 

12 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 02 Jul 2010, 01:43 PM
Hi Jason,

We tried to reproduce the problem, but without much success. Please find attached a project as part of our local tests.

What might be the difference in your case? Are we missing something?

Kind regards,
Helen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason Gajewski
Top achievements
Rank 1
answered on 02 Jul 2010, 03:28 PM
I apologize that I left this out in the original post.  I am running Visual Studio 2010. 

After taking your sample and putting into VS2010, the example did not work.  I am experiencing the same problems as I originally posted.
0
Helen
Telerik team
answered on 02 Jul 2010, 04:23 PM
Hi Jason,

I'm still unable to reproduce the problem. Please find attached a movie as part of our local tests.

What are we missing?

Greetings,
Helen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason Gajewski
Top achievements
Rank 1
answered on 02 Jul 2010, 04:40 PM
what can i provide to assist in the resolution?

Can you provide me the complete Visual Studio 2010 solution so that I can try it on my machine? 

FYI... i'm not the only person in house that is having this problem.  3 other developers have also looked at it and having the same issue.
0
Helen
Telerik team
answered on 06 Jul 2010, 11:56 AM
Hello Jason,

Please find attached our test project. It works locally.

Greetings,
Helen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason Gajewski
Top achievements
Rank 1
answered on 06 Jul 2010, 10:50 PM
This zip does not contain all visual studio 2010 project files.
  1. It is missing the project files
  2. It is missing the designer files

I have created a project and able to migrate the code over via copy/paste, but I want to make sure I'm not missing any other project level setting.

0
Jason Gajewski
Top achievements
Rank 1
answered on 06 Jul 2010, 11:09 PM
I too have recorded a video that shows my test project.  I do not have access to upload a zip file to this forum though.  Is there a way I can send it directly?
0
Yana
Telerik team
answered on 07 Jul 2010, 10:17 AM
Hello Jason,

Actually this is a web site that can be easily opened with Visual Studio 2010.
Regarding the second question -  you should open a support ticket and send us your files there. 

Could you please try to modify our example so that it reproduces the issue and send it back to us? Thanks in advance

Regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason Gajewski
Top achievements
Rank 1
answered on 07 Jul 2010, 04:59 PM
The difference is that I am using a web APPLICATION.  I have successfully been able to get it to work within a web SITE... now I will try a web APPLICATION utilizing the same code.
0
Jason Gajewski
Top achievements
Rank 1
answered on 07 Jul 2010, 06:33 PM

The problem was in the web.config file.

The following is required in the "pages" node of "system.web":

clientIDMode="AutoID" 

http://blog.hmobius.com/post/2010/02/25/ASPNET-Part-8-Introducing-ClientIDMode.aspx 

 

0
Blake Marriner
Top achievements
Rank 1
answered on 08 Jul 2010, 07:51 PM
Hi, I think I've come across a similar problem. This is the basic example..
master page
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="home_MasterPage" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

aspx page
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="home_Default"
    MasterPageFile="~/home/MasterPage.master" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
        <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true">
            <Items>
                <telerik:RadComboBoxItem Text="a" />
                <telerik:RadComboBoxItem Text="b" />
                <telerik:RadComboBoxItem Text="c" />
            </Items>
        </telerik:RadComboBox>
    </telerik:RadAjaxPanel>
</asp:Content>

running IIS7.5 under the Configuration>System.Web>Pages> section of web.config first set ClientModeID=AutoID
control should respond as expected, now remove the ClinetModeID tag in web.config so the conrolID's are generated in the new Pedictable method and the contol will not respond after the first postback due to a dropped autocomplete="off" element in the rendering...

Are there any plans to incorperate the new default ClientModeID method into the controls?
0
Yana
Telerik team
answered on 14 Jul 2010, 01:42 PM
Hello Blake,

The issue with the ClientIDMode is already fixed in Q2 2010 release.

Sincerely yours,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Jason Gajewski
Top achievements
Rank 1
Answers by
Helen
Telerik team
Jason Gajewski
Top achievements
Rank 1
Yana
Telerik team
Blake Marriner
Top achievements
Rank 1
Share this question
or