Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
155 views
Hi!
We have an ASP.NET page with a lot of Rad controls including (Textboxes, Lists, comboboxes) and a RadGrid. I'm trying to improve the performance of the page and currently about 35% of the page size is occupied by the script blocks of Rad controls. Example of the javascript statements are mentioned below and these get repeated for each control. I'm guessing that this gets generated on-the-fly when the control is spitted out to HTML.

Is there a way one could compress/minimize the javascript code on the page? Any help/suggestions would be appreciated.


------------Example Javascript function calls on the page ----------
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadTextBox, {"_focused":false,"_postBackEventReferenceScript":"setTimeout(\"__doPostBack(\\\u0027ctl00$PageContent$woMaint$tbxRateSchedule\\\u0027,\\\u0027\\\u0027)\", 0)","_skin":"WebBlue","clientStateFieldID":"ctl00_PageContent_woMaint_tbxRateSchedule_ClientState","enabled":true,"styles":{HoveredStyle: ["width:50%;", "riTextBox riHover"],InvalidStyle: ["width:50%;", "riTextBox riError"],DisabledStyle: ["width:50%;", "riTextBox riDisabled"],FocusedStyle: ["width:50%;", "riTextBox riFocused"],EmptyMessageStyle: ["width:50%;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:50%;", "riTextBox riRead readonly"],EnabledStyle: ["width:50%;", "riTextBox riEnabled"]}}, null, null, $get("ctl00_PageContent_woMaint_tbxRateSchedule"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadTextBox, {"_focused":false,"_postBackEventReferenceScript":"setTimeout(\"__doPostBack(\\\u0027ctl00$PageContent$woMaint$tbxLoanType\\\u0027,\\\u0027\\\u0027)\", 0)","_skin":"WebBlue","clientStateFieldID":"ctl00_PageContent_woMaint_tbxLoanType_ClientState","enabled":true,"styles":{HoveredStyle: ["width:80px;", "riTextBox riHover"],InvalidStyle: ["width:80px;", "riTextBox riError"],DisabledStyle: ["width:80px;", "riTextBox riDisabled"],FocusedStyle: ["width:80px;", "riTextBox riFocused"],EmptyMessageStyle: ["width:80px;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:80px;", "riTextBox riRead readonly"],EnabledStyle: ["width:80px;", "riTextBox riEnabled"]}}, null, null, $get("ctl00_PageContent_woMaint_tbxLoanType"));
});
Johny
Top achievements
Rank 1
 answered on 13 Jul 2011
6 answers
2.6K+ views
Hi,
In my current project, I am using Visual Studio 2008, .NET Framework 3.5 and Telerik 2011 Q1.
On one of the web pages which use a common master page, I need to retrieve the value of a Session whose is set by the code behind.

<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">
    <script type="text/javascript">
        function showConfirm() {
            var exist = '<%= Session("SubscriptionsExist")%>';
            ...
        }
    </script>
    ...
</asp:Content>

I got the following error message
Compiler Error Message: CS0103: The name 'Session' does not exist in the current context

If I used the following instead
var exist = '<%= Session("SubscriptionsExist")%>';
I got the following error message
Compiler Error Message: CS1955: Non-invocable member 'System.Web.HttpContext.Session' cannot be used like a method.

Can you please help me?

Regards,
Herman
Bojjaiah
Top achievements
Rank 1
 answered on 13 Jul 2011
1 answer
169 views
Hello,

Maybe I don't understand correctly but I thought that I could override the default css styling....?? For example
telerik:RadTreeView ID="MyAppsTreeView" runat="server" CheckBoxes="True" TriStateCheckBoxes="true" CheckChildNodes="true" Skin="Windows7">
    <Nodes>
        <telerik:RadTreeNode Text="Centura Health Resource" Expanded="true" CssClass="CategoryNode">
            <Nodes>........

and I have a css file:
.CategoryNode
{
    width: 186px !important;
    height: 35px !important;
    background: transparent url('../images/PhysSteth.png') no-repeat !important;
}

The image displays as it should but the width and height do not???

Any help would be greatly appreciated.



Shinu
Top achievements
Rank 2
 answered on 13 Jul 2011
2 answers
53 views
I have a RadGrid where each row has an Edit button that opens an edit form that is in a Web UserControl.

These work fine. Say I edit row 1, but then click on the Edit button on Row 2, Row 1 closes as expectd.

However, If I click on say row 1 but then click the Add New Record link, Row 1 stays open along with a new blank form for the row I am adding.

When Adding a new record, how do I close all other edit forms?
Brad
Top achievements
Rank 1
 answered on 13 Jul 2011
3 answers
127 views
Hello,i have a string date time such as '8/15/2011 12:00:00 AM' ,so how to add to picker ?

Thanks,
Trung Hiếu
Princy
Top achievements
Rank 2
 answered on 13 Jul 2011
1 answer
81 views
Hello, everyone

 I refer the demo code and use the following code to build arraylist.

=================================
public class MyObjECG
    {
        public string _date = "";
        public string _time = "";

        public MyObjECG()
        {
        }

        public MyObjECG(string strDate, string strTime)
        {
            _date = strDate;
            _time = strTime;
        }
        public string Date
        {
            get
            {
                return _date;
            }
        }
        public string Time
        {
            get
            {
                return _time;
            }
        }
    }
================================= 
I want to show these data in two rows. It likes outlook style 'form/subject'. So I add '<telerik:GridTemplateColumn>' in my gridview. 
When I set  '<telerik:GridTemplateColumn>' in my grid, the grid view will show twice data like the following.

Date/Time            Date                Time
===============================
2011/07/18       2011/07/18          18:00
18:00

I just want to show.

Date/Time        
===========
2011/07/18       
18:00

Anybody help me ??

Thanks, Tseng

Shinu
Top achievements
Rank 2
 answered on 13 Jul 2011
6 answers
308 views
I have a web form with 2 radbutton. Approve and Reject. When Reject button is clicked. I would like to pop up radprompt to capture reject reason and update the reason via stored proc from code behind.
How can I capture the reason and using it from code behind?
cheekl
Top achievements
Rank 2
 answered on 13 Jul 2011
2 answers
92 views
Could you add demo on exporting child hierarchy within the grid as well?

http://demos.telerik.com/aspnet-ajax-beta/grid/examples/generalfeatures/exporting/defaultcs.aspx
Daniel
Telerik team
 answered on 12 Jul 2011
1 answer
42 views
Hi All,

  I am following the example of the related comboxes.
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

 I have two related comboboxes and an add button Once the user selected from both the radComboBox_filters and radCombox_E comboxes, he can add the selection to the listbox RadListBox_EFilters on the right side.

My problem is that radComboBox_filters does not display "Select filters" at the top of the comboxBox because I want to display "select filters" at the top of the combox. Also, If I select something from the RadCombobox_filters, the radCombox_E will be populated with data. Once I select something from the radcombox_e and click the add button, radCombox_E gets cleared out. I don't want the radCombox_E to be cleared out just becasue I clicked on add button.
How can I fix that because I don't want the readCombox_e to be cleared out once i push the add button. Below is my code.
<script type="text/javascript">
    var ECombo;
     
function pageLoad() {
      
    ECombo = $find('<%= RadPanelBar1.Items[0].Items[0].FindControl("RadComboBox_E").ClientID %>');
  
}
  
function RadComboBox_E_Load(combo, eventArgs) {
  
    var item = eventArgs.get_item();
  
    ECombo.set_text("Loading...");    
    if (item.get_index() > 0) {
  
       ECombo.requestItems(item.get_textElement().innerText, false);
    }
    else {
        ECombo.set_text(" ");
        ECombo.clearItems();
  
    }
}
function ItemsLoaded(combo, eventArqs) {
     
    if (combo.get_items().get_count() > 0) {
        // pre-select the first item
        combo.set_text(combo.get_items().getItem(0).get_text());
        combo.get_items().getItem(0).highlight();
    }
    combo.showDropDown();
}
  
  
  
</script>
  
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="1500px" BackColor="#E6E6E6" ExpandMode="MultipleExpandedItems">
            <Items>
                <telerik:RadPanelItem runat="server" Text="Filters" Expanded="true">
                    <items>
                        <telerik:RadPanelItem Text="">
                            <ItemTemplate>
                                <table width="20%" cellpadding="0" cellspacing="0">
    <tr>
        <td style="width:10%">
        Filters:
         <telerik:RadComboBox ID="RadComboBox_filters" 
                runat="server" 
                Width="200px" 
                  
                OnClientSelectedIndexChanging="RadComboBox_E_Load" 
                onitemsrequested="RadComboBox_filters_ItemsRequested" EmptyMessage="Select Filters" HighlightTemplatedItems="true" Filter="StartsWith"></telerik:RadComboBox>
  
          </td>
          <td> </td>
          <td style="width:10%">
           E:
            <telerik:RadComboBox ID="RadComboBox_E" 
                runat="server" 
                ClientIDMode="Static"
                Width="200px" 
               OnClientItemsRequested="ItemsLoaded" onitemsrequested="RadComboBox_E_ItemsRequested" MarkFirstMatch="true" EmptyMessage="Please Select.."/>
        </td>
        <td> </td>
         <td> </td>
          <td> </td>
        <td style="width:10%"><br />
                <telerik:RadButton ID="RadButton_Add" runat="server" Text="Add" 
                       onclick="RadButton_Add_Click">
                        <Icon SecondaryIconCssClass="rbAdd" SecondaryIconRight="4" SecondaryIconTop="4" />
                    </telerik:RadButton>
          
        </td>
        <td style="width:10%">
             <telerik:RadListBox runat="server" ID="RadListBox_EFilters"  AutoPostBack="false"
                    SelectionMode="Single" Width="600px" Height="200px" AllowDelete="true">
                    </telerik:RadListBox>
        </td>
        <td style="width:80%"> </td>
      
    </tr>
  
  
</table>
  
  
                            </ItemTemplate>
                        </telerik:RadPanelItem>
                    </items>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>

Any help will be appreciated.

Anjali
Top achievements
Rank 1
 answered on 12 Jul 2011
2 answers
157 views
Hi All, I am using the Demo code for using the automatic editing features of the grid, but regardless of if I "edit" a record or "Insert" a record, only the "Update" ever shows, "Insert" Button never does. Using the following code:
Q1 2011
RadGrid settings
           AllowAutomaticInserts="true" 
           AllowAutomaticUpdates="true" 
           AllowAutomaticDeletes="true"  
    
    
Command buttons:  "Insert" Button never shows. 
    <td colspan="99"
        <asp:Button 
            ID="btnUpdate" 
            Text="Update" 
            runat="server" 
            CommandName="Update" 
            Visible='<%# !(Container is Telerik.Web.UI.GridInsertionObject) %>'> 
        </asp:Button
        <asp:Button 
            ID="btnInsert" 
            Text="Insert" 
            runat="server" 
            CommandName="PerformInsert"
            Visible='<%# Container is Telerik.Web.UI.GridInsertionObject %>'> 
        </asp:Button
Thanks,

Matt


Matt
Top achievements
Rank 1
 answered on 12 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?