Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
139 views

umm... what is this error I see on every pages?

a[i].getAttribute("href") is null


It seems in this function: (line 33 is where it breaks)

// Iterates through all the <a> links on a page and adds   
// them to the queue to be prefetched.  
function doEnhancedPrefetch(aEvent, pos) {  
 
    // exit if enhanced prefetching is turned off  
    // or if the site has opted out of prefetching  
    if(!PreferencesService.getBoolPref("extensions.fasterfox.enhancedPrefetching")) return;  
      
    // doc is document that triggered "onload" event  
    var doc = aEvent.originalTarget;   
      
    // if this isn't an http:// page, retun  
    if (doc.location.href.indexOf("http://") != 0) return;  
          
    // load whitelist  
    var whitelist = PreferencesService.getCharPref("extensions.fasterfox.whitelist").split(",");  
    var whitelistLen = whitelist.length;  
      
    // find all links  
    var a = doc.getElementsByTagName('a');  
    var href, numLinksToPrefetch, i, j;  
      
    // prefetch a max of 100 links  
    numLinksToPrefetch = (a.length>100) ? 100 : a.length;  
 
    // if its the first time, set the pos to 0,  
    // if a pos was passed in, we'll start the for loop there instead  
    if (pos == null || pos <=0) pos = 0;  
      
    // iterate through the links  
    mainLinkLoop:   
    for (i=pos; i<numLinksToPrefetch; i++) {  
        href = a[i].getAttribute('href').toLowerCase();  
          
        // make sure there is a link  
        if(href && href.length > 4) {  
 
            // Don't prefetch links w/ query strings  
            // or the same page we are on  
            if(href.indexOf('?')>=0 || href == doc.location.href) continue;  
              
            // Don't prefetch things that look like a logout link  
            // Special thanks to b1naryb0y and Kai Risku for this bug fix  
            if(href.indexOf('logout')>=0 || href.indexOf('logoff')>=0) continue;  
              
            // Only prefetch static content, this causes dynamic pages to be ignored  
            fileExtensionStartPos = href.length-4;  
            if(!(href.indexOf('.htm') == fileExtensionStartPos   
              || href.indexOf('.html') == fileExtensionStartPos-1  
              || href.indexOf('.jpg') == fileExtensionStartPos  
              || href.indexOf('.gif') == fileExtensionStartPos  
              || href.indexOf('.png') == fileExtensionStartPos  
              || href.indexOf('.jpeg') == fileExtensionStartPos-1  
              || href.indexOf('.txt') == fileExtensionStartPos  
              || href.indexOf('.text') == fileExtensionStartPos-1  
              || href.indexOf('.xml') == fileExtensionStartPos  
              || href.indexOf('.pdf') == fileExtensionStartPos)) continue;  
                
            // Don't prefetch whitelist links  
            href = ff_GetAbsoluteUrl(href, doc.location.href);  
            for(j=0; j<whitelistLen; j++) {  
                if(whitelist[j].length > 0 && href.indexOf(whitelist[j]) >= 0) continue mainLinkLoop;                 
            }  
              
            // test if site is opting out of prefetching  
            var shouldOptOut = ff_IsSiteOptOut(href, aEvent, i);  
            if(shouldOptOut) {  
                continue;  
            } else if (shouldOptOut == -1) {  
                return;  
            }  
              
            try {  
                PrefetchService.prefetchURI(ff_makeURI(ff_GetAbsoluteUrl(a[i].getAttribute('href'), doc.location.href)), ff_makeURI(doc.location.href), true);  
            } catch(e) {   
                //if(e.name != "NS_ERROR_ABORT") alert(ff_GetAbsoluteUrl(href, doc.location.href) + '\n' + e.toString());   
            }  
        }  
    }  
 
}  
 

DGDev
Top achievements
Rank 2
 answered on 22 Dec 2008
0 answers
76 views
Disregard. Thanks.
Karl Wilkens
Top achievements
Rank 1
 asked on 22 Dec 2008
1 answer
121 views
I'm not sure if the title is what the issue is but that's what i'm thinking. When the scheduler loads and i select "monthly" the initial dates don't show up until i go to the next month. Once i do see the dates they are showed as recurring but only by the recurring icon and not actually recurring on the scheduler. The kicker is that the appointments show up after i either edit then click cancel or delete one of the appointments shown...Heres a video to show you what im talking about. Not sure why it won't give the high res option.
Heres my code...
    Public Sub AddAppointments() 
        RadCal.Appointments.Clear() 
 
        Dim rd As SqlClient.SqlDataReader = Data.SqlHelper.ExecuteReader(ConnString, "dbo.JobSelect"
        While rd.Read 
 
            Dim range As New RecurrenceRange 
            range.Start = rd.GetDateTime(12) 
            range.EventDuration = rd.GetDateTime(13) - rd.GetDateTime(12) 
 
            Select Case rd.GetInt32(5) 
                Case 4 
                    Dim DailyRR As New DailyRecurrenceRule(rd.GetInt32(6), range) 
 
                    Dim da As New Appointment(rd.GetInt32(0), rd.GetDateTime(12), rd.GetDateTime(13), rd.GetString(1), DailyRR.ToString) 
                    RadCal.InsertAppointment(da) 
                    RadCal.DataKeyField = da.ID 
                    RadCal.DataStartField = da.Start 
                    RadCal.DataEndField = da.End 
                    RadCal.DataSubjectField = da.Subject 
                Case 8 
                    Dim WeeklyRR As New WeeklyRecurrenceRule(rd.GetInt32(10), rd.GetInt32(6), range) 
 
                    Dim da As New Appointment(rd.GetInt32(0), rd.GetDateTime(12), rd.GetDateTime(13), rd.GetString(1), WeeklyRR.ToString) 
                    RadCal.InsertAppointment(da) 
                    RadCal.DataKeyField = da.ID 
                    RadCal.DataStartField = da.Start 
                    RadCal.DataEndField = da.End 
                    RadCal.DataSubjectField = da.Subject 
                Case 16 
                    Dim MonthlyRR As New MonthlyRecurrenceRule(rd.GetInt32(6), rd.GetInt32(10), range) 
 
                    Dim da As New Appointment(rd.GetInt32(0), rd.GetDateTime(12), rd.GetDateTime(13), rd.GetString(1), MonthlyRR.ToString) 
                    RadCal.InsertAppointment(da) 
                    RadCal.DataKeyField = da.ID 
                    RadCal.DataStartField = da.Start 
                    RadCal.DataEndField = da.End 
                    RadCal.DataSubjectField = da.Subject 
                Case 32 
                    Dim MonthlyRelativeRR As New MonthlyRecurrenceRule(rd.GetInt32(9), rd.GetInt32(6), rd.GetInt32(10), range) 
 
 
 
                    Dim da As New Appointment(rd.GetInt32(0), rd.GetDateTime(12), rd.GetDateTime(13), rd.GetString(1), MonthlyRelativeRR.ToString) 
                    RadCal.InsertAppointment(da) 
                    RadCal.DataKeyField = da.ID 
                    RadCal.DataStartField = da.Start 
                    RadCal.DataEndField = da.End 
                    RadCal.DataSubjectField = da.Subject 
            End Select 
 
        End While 
        rd.Close() 
 
    End Sub 

Ben
Top achievements
Rank 1
 answered on 22 Dec 2008
2 answers
191 views
Does anyone know how to set styles, etc., for the pop-up filter menu (menu that lets you select "no filter", "begins with", etc.) for RadGrid?  It appears to be using the link style settings for the page itself, but with the text and background colors we are using (and need to use to keep consistency with other pages and products), it looks terrible and is not readable.

Thanks.
Peter
Top achievements
Rank 1
 answered on 22 Dec 2008
5 answers
222 views
Is there a way to set the width of a RadPanelItem through client script in the OnClientItemExpand event?
jfkrueger
Top achievements
Rank 1
 answered on 22 Dec 2008
1 answer
218 views
While using the Telerik Trainer and following the video on the Loading panel and the RadAjaxmanager and proxy I have run into a problem.  I following the video step by step and even retraced my steps but as soon as I created the master page and moved my RadAjaxManager from my contant page to my master page and added the RadAjaxManagerProxy it has started to post back and refresh the screen.  Now when I go to the RadAjaxManagerProxy and go to Configure Ajax Manager there are no controls even though there is within that page and even when it is hard coded with those controls it doesn't see them.  I need to find a solution asap for a work project.

Any suggestions?

Master Page HTML Code
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="TelerikTools.Site1" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!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>Untitled Page</title> 
    <asp:ContentPlaceHolder ID="head" runat="server">  
    </asp:ContentPlaceHolder> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
      </telerik:RadAjaxManager> 
            
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
          
            
          
        </asp:ContentPlaceHolder> 
          
      <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"   
      height="75px" InitialDelayTime="10" IsSticky="True" MinDisplayTime="5000"   
      width="75px">  
      <img alt="Loading..." src="RadControls/Ajax/Skins/Default/loading1.gif"   
        style="border:0px;" /><br /> 
      Add Some Text  
    </telerik:RadAjaxLoadingPanel> 
      
    </div> 
    </form> 
</body> 
</html> 


Contant Page HTML
<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="RadAjaxManager.aspx.cs" Inherits="TelerikTools.RadAjaxManager" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<asp:Content ID="Content1" runat=server ContentPlaceHolderID=ContentPlaceHolder1>  
    <div> 
      
      <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
      </telerik:RadScriptManager> 
      
    </div> 
    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True"   
      oncheckedchanged="CheckBox1_CheckedChanged" Text="Check Me" />      
    <asp:Label ID="Label1" runat="server"></asp:Label> 
      
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"   
      DataSourceID="SqlDataSource1" GridLines="None">  
<MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
  <Columns> 
    <telerik:GridBoundColumn DataField="STATE_NM" EmptyDataText="&amp;nbsp;"   
      HeaderText="STATE_NM" SortExpression="STATE_NM" UniqueName="STATE_NM">  
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="CITY_NM" EmptyDataText="&amp;nbsp;"   
      HeaderText="CITY_NM" SortExpression="CITY_NM" UniqueName="CITY_NM">  
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="ZIPCODE" EmptyDataText="&amp;nbsp;"   
      HeaderText="ZIPCODE" SortExpression="ZIPCODE" UniqueName="ZIPCODE">  
    </telerik:GridBoundColumn> 
  </Columns> 
  <PagerStyle Mode="NextPrevAndNumeric" /> 
</MasterTableView> 
 
<FilterMenu EnableTheming="True">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
</telerik:RadGrid> 
 
 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
      ConnectionString="<%$ ConnectionStrings:ConnectionString %>"   
      ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"   
      SelectCommand="SELECT &quot;STATE_NM&quot;, &quot;CITY_NM&quot;, &quot;ZIPCODE&quot; FROM &quot;TBL_STATECITY_V&quot;">  
    </asp:SqlDataSource> 
 
      
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
      <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="CheckBox1">  
          <UpdatedControls> 
            <telerik:AjaxUpdatedControl ControlID="Label1" /> 
          </UpdatedControls> 
        </telerik:AjaxSetting> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1">  
          <UpdatedControls> 
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
          </UpdatedControls> 
        </telerik:AjaxSetting> 
      </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
      
      
    </asp:Content> 

Contant Page C#
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
 
namespace TelerikTools  
{  
  public partial class RadAjaxManager : System.Web.UI.Page  
  {  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
 
    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)  
    {  
      System.Threading.Thread.Sleep(1000);  
      if (CheckBox1.Checked)  
      {  
        Label1.Text = "This box is checked";  
      }  
      else 
      {  
        Label1.Text = "The box is NOT checked";  
      }  
    }  
  }  
}  
 


Thank you for any help

Jerry

jerry
Top achievements
Rank 1
 answered on 22 Dec 2008
2 answers
211 views
The vertical scrollbar is very responsive.
The horizontal scrollbar is very very sluggish. Unacceptable to any user. There are only 14 columns in the resultset being returned from a SQL Server sproc via a SqlDataAdapter.  There are 53 rows in the resultset.
What could be the reason for that?
Thank you,
Greg
        <telerik:RadGrid ID="RadGrid1" runat="server" BorderColor="Black"   
            DataSourceID="SqlDataSource1" OnColumnCreated="RadGrid1_ColumnCreated"   
            AutoGenerateColumns="False" GridLines="None" > 
         <ClientSettings> 
           <Scrolling AllowScroll="True" UseStaticHeaders="True" 
                  FrozenColumnsCount="1">  
           </Scrolling> 
         </ClientSettings> 
Hazzard
Top achievements
Rank 1
 answered on 22 Dec 2008
7 answers
235 views
I am fairly new at ASPX programming and telerik,  

I have updated the mastertable form to allow entries, placed a droplist on it for choice of type. 

if anyone has a clue on what I need to do to access the value of that drop list, I would appreciate the help...

        GridEditFormItem updItem = (GridEditFormItem)e.Item;
        
        string iCussysid = Session["cussysid"].ToString();

      // trying to get this value in iTypeAccount
        string iTypeAccount = (updItem["TypeAccount"].Controls[0] as DropDownList).SelectedItem.Text;
   // here

        string iAcctBalance = (updItem["AcctBalance"].Controls[0] as TextBox).Text;
        string iTradeAccountNo = (updItem["TradeAccountNo"].Controls[0] as TextBox).Text;

        try
        {
            //Open the SqlConnection    
            string sqlStatement = "Update Dbo.CustomerAccounts "+
                            " Set TypeAccount = '"+iTypeAccount+"',"+
                            " AcctBalance = "+Convert.ToDecimal(iAcctBalance)+","+
                            " TradeAccountNo = " + Convert.ToInt32(iTradeAccountNo) + 
                            " Where cussysid = "+Convert.ToInt32(iCussysid);


thanks.
Iana Tsolova
Telerik team
 answered on 22 Dec 2008
2 answers
129 views

Hopefully this is a very easy one. How do I set the selected text property declaritively with the bind syntax? I do not want selectedvalue, i need to use SelectedText or the Telerik equivalent?

This does not work and there is no "SelectedText" property:

<telerik:RadComboBox ID="rcbCategory" runat="server" 
     DataSourceID="odsCategories" DataTextField="Category" 
     DataValueField="CategoryID" Width="75px"   
     ShowDropDownOnTextboxClick="true"   
     Height="150px" Text='<%# Bind("CategoryName") %>'>  
</telerik:RadComboBox> 


Thanks!

jfkrueger
Top achievements
Rank 1
 answered on 22 Dec 2008
2 answers
99 views
Hello!

I have a radgrid where i have to set the edit property of the rows to true or false, if the sorting was changed because of an update.
I'm doing this at ItemDataBound.
This worked fine for me all the time - I had never a problem with that.
Today I made an update from Q3 to the latest version of telerik. 
Since this update I'm getting an error (Object reference not set to an instance of an object).
This error occurs right after ItemDataBound - so my error handling does not fire an error. The problem occurs after one of this events. The error occurs before the DataBound Event.

So I have two versions with the same code - one with the older dll and one with the newer dll - With the older one everything is fine and the newer one is making problems. So I'm afraid of upgrading versions in future - but i will have to do that!

The code:

If

 

(TypeOf (e.Item) Is GridDataItem) Then

 

 

Dim dataBoundItem As GridDataItem = Nothing

 

 

Dim bFound As Boolean = False

 

 

Try

 

dataBoundItem = e.Item

 

If Session("sessSaveIds") <> "" Then

 

 

Dim sArrayString As String = Session("sessSaveIds")

 

 

Dim sArray() As String = sArrayString.Split(",")

 

 

Dim sID As String

 

 

For Each sID In sArray

 

 

If dataBoundItem("user_id").Text = sID Then

 

bFound =

True

 

 

Exit For

 

 

End If

 

 

Next

 

 

If bFound = True Then

 

dataBoundItem.Edit =

True

 

 

Else

 

dataBoundItem.Edit =

False

 

 

End If

 

 

End If ...

 



What can I do? Please help me!
Georgi Krustev
Telerik team
 answered on 22 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?