Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
554 views
Hello Telerik,
I got this error after I try to use upload control a couple of times. I know it's caused by the stream's not disposed but I think I did that already...
Here is my code:

...  
            foreach (UploadedFile file in FileUpload.UploadedFiles)  
            {  
                file.SaveAs();                             
            }  
...  
 
            foreach (UploadedFile file in FileUpload.UploadedFiles)  
            {  
                file.InputStream.Close();  
                file.InputStream.Dispose();                 
            } 

still get the error, any idea?

Cheers,
Elton
Sophy
Telerik team
 answered on 22 Apr 2008
2 answers
248 views
This may be related to my other post Selected Tab lost when PageView set not to render.  I've found that when you click on a tab, the built-in event handler fails with a null reference exception.

[NullReferenceException: Object reference not set to an instance of an object.] 
   Telerik.Web.UI.RadTabStrip.PerformValidation(RadTab tab) +167 
   Telerik.Web.UI.RadTabStrip.RaisePostBackEvent(String eventArgument) +53 
   Telerik.Web.UI.RadTabStrip.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 

My main problem with this is that I have pages that check for authorized access every time they are loaded.  If the user has attempted to access a function for which they are not authorized, my base page class hides the main content window and replaces it with an "Unauthorized Access" message (or takes some other appropriate action).  In my own event handlers, I check to see if the user/action is authorized (since the event handlers still fire) and simply don't perform the task if the authorization check fails.

I had no problems with this using the old tab strip.  With the upgrade to the tabstrip in RadControls for ASP.Net Ajax, it seems not to like it if the tabs are hidden during the built-in click handling.

I've spent several hours now trying to track this down, wondering just what changed in my application, and I was able to narrow it down to the built-in tab event handling with the following page code:

<%@ Page Language="VB" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<script runat="server"> 
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
        MainContent.Visible = Not ToBeHidden.Checked 
    End Sub 
     
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div id="MainContent" runat="server"> 
     
    <asp:ScriptManager ID="SM1" runat="server" /> 
     
        <asp:CheckBox ID="ToBeHidden" runat="server" Text="Hide Me" /> 
 
        <telerik:RadTabStrip ID="TabStrip1" AutoPostBack="true" MultiPageID="MP1" runat="server" > 
            <Tabs> 
                <telerik:RadTab Text="Tab 1" Value="1" PageViewID="PV1" /> 
                <telerik:RadTab Text="Tab 2" Value="2" PageViewID="PV2" /> 
                <telerik:RadTab Text="Tab 3" Value="3" PageViewID="PV3" /> 
                <telerik:RadTab Text="Tab 4" Value="4" PageViewID="PV4" /> 
                <telerik:RadTab Text="Tab 5" Value="5" PageViewID="PV5" /> 
            </Tabs> 
        </telerik:RadTabStrip> 
             
        <telerik:RadMultiPage ID="MP1" RenderSelectedPageOnly="false" runat="server" > 
             
            <telerik:RadPageView ID="PV1" runat="server"> 
                <h1>Page View 1</h1> 
            </telerik:RadPageView> 
             
            <telerik:RadPageView ID="PV2" runat="server"> 
                <h1>Page View 2</h1> 
            </telerik:RadPageView> 
             
            <telerik:RadPageView ID="PV3" runat="server"> 
                <h1>Page View 3</h1> 
            </telerik:RadPageView> 
             
            <telerik:RadPageView ID="PV4" runat="server"> 
                <h1>Page View 4</h1> 
            </telerik:RadPageView> 
             
            <telerik:RadPageView ID="PV5" runat="server"> 
                <h1>Page View 5</h1> 
            </telerik:RadPageView> 
             
        </telerik:RadMultiPage> 
 
    </div> 
    </form> 
</body> 
</html> 
 

In this example, all I've done is add a checkbox (line 23) that turns visible="false" for the MainContent div (line 19).  With the checkbox cleared, and as such the content remaining visible, you can click on the tabs to your heart's content.  However, if you check the box and click any tab, the page loads, the MainContent area is hidden, and the built-in event handler fails with the null reference exception.  I further tested the fact that it's the event handler by simply setting the MainContent div to hidden in the Page_Load and just loaded the page and there was no error.  No content visible, of course, but also no error.

Thank you again for looking into this.
LeBear
Top achievements
Rank 1
 answered on 22 Apr 2008
3 answers
159 views
I don't understand, the PersistStateInCookie property didn't work,
that didn't restore the state.
It work perfect with Radcontrols for asp.net, I didn't change anything on the code
here the code I use
<telerik:RadPanelBar ID="RpnNav" runat="server" DataSourceID="Smds"  
  Width="100%" Height="100%" CausesValidation="false" 
  PersistStateInCookie="true" ExpandMode="FullExpandedItem"> 
  <CollapseAnimation Type="InBounce" Duration="100"></CollapseAnimation> 
</telerik:RadPanelBar> 
I try to add in the databound of radpanelbar the example of code of the site to display the selected item but it always have the value of nothing.
    Private Sub RpnNav_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RpnNav.DataBound 
        Dim selectedItem As RadPanelItem = RpnNav.SelectedItem 
        If Not (selectedItem Is Nothing) Then 
            Label1.Text = [String].Format("This is the {0} page", selectedItem.Text) 
        End If 
    End Sub 


Anyone coulf help me ?

Thanks

Maveric





Rosi
Telerik team
 answered on 22 Apr 2008
1 answer
138 views
Before ASP.NET AJAX we added a custom style to the menu stylesheet in order to display a context menu item as selected. For example, if you have a "Sort Ascending" menu item that has been selected then we would change the background color of the icon on the menu item to a highlight color and then put a border around it.

This seems like a pretty common requirement to me. Is there any built-in way of doing this with the ASP.NET AJAX version? I have looked for it in the stylesheet but wanted to double-check to see if I overlooked something.


Thank you,
Terry
Erjan Gavalji
Telerik team
 answered on 22 Apr 2008
2 answers
253 views
I set width and Height of a radWindow in "OnClinetshow". The result is not the expected one. Width is working correctly and in the first Moment also the Height but a short time later the heigth increases. Isn't the "OnClientshow" the correct place to set those properties or what is wrong?
Markus
Top achievements
Rank 1
 answered on 22 Apr 2008
1 answer
198 views

I have a horizontal menu bar. And then I have IFRAME filling the whole page. Item from menu opens a url inside the IFRAME.

Towards the bottom of the IFRAME - i have a calendar that I am opening up above the calendar button. I got the code from the user manual:

function ShowPopupAbove(sender, eventArgs)
{
 var picker = $find("<%= RadDatePicker1.ClientID %>");
 var textBox
= picker.get_textBox();
 var popupElement
= picker.get_popupContainer();
 var dimensions
= picker.getElementDimensions(popupElement);
 var position
= picker.getElementPosition(textBox);
 picker.showPopup(position.x, position.y
- dimensions.height);
}

THe window is opening up fine, but the IFRAME scrolls upward in the main window when calendar opens up. that probably is for the amount of size it needs below the calendar button. But since I am opening up the window above there is no need to scroll the page. Because of the scroll my menu at the top also scrolls out of the window.

Any solution? Should I set the z-index of IFRAME to something to stop it?




Steve
Telerik team
 answered on 22 Apr 2008
2 answers
228 views
are there any sample projects available that show the use of the RADScheduler ?
The help file isnt particlarly great.  I cant find a script anywhere that would create the necessary table structure to use the scheduler in my own applications.  Am I supposed to create the script myself  from SchedulerData.mdf ?
I know its still technically in beta, but why arent there any examples available ?
Peter
Telerik team
 answered on 22 Apr 2008
1 answer
169 views
If you use client script to disable a button in a tool bar click event handler, the hover behavior becomes inverted. Try this:

function toolBarClicking(sender, args){
    args.get_item().disable();
}

Whatever button you clicked will now show a hover effect when you move off of it, even though the button is disabled.

Erjan Gavalji
Telerik team
 answered on 22 Apr 2008
1 answer
88 views
I thing that i found a bug. Tabstrip not working with asp:login together becouse tabstip fire validators in asp:login.
Code sample:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ITDT.Gossip.Portal.WebForm1" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!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> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
    <div> 
    <asp:Login runat="server"></asp:Login> 
            <telerik:RadTabStrip ID="RadTabStrip1" runat="server"> 
            <Tabs> 
                <telerik:RadTab runat="server" Text="Tab1" PerTabScrolling="True" ScrollChildren="True" 
                    Selected="True"> 
                    <Tabs> 
                        <telerik:RadTab runat="server" Text="Child Tab 1" /> 
                        <telerik:RadTab runat="server" Text="Child Tab 2" Selected="True" /> 
                        <telerik:RadTab runat="server" Text="Child Tab 3" /> 
                        <telerik:RadTab runat="server" Text="Child Tab 4" /> 
                        <telerik:RadTab runat="server" Text="Child Tab 5" /> 
                    </Tabs> 
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Tab2" /> 
                <telerik:RadTab runat="server" Text="Tab3" /> 
            </Tabs> 
        </telerik:RadTabStrip> 
    </div> 
    </form> 
</body> 
</html> 
 

Paul
Telerik team
 answered on 22 Apr 2008
1 answer
128 views
Hi,

I've ran into an issue with the rad window. Scenario: I have a page that has a vertical scroll bar, i open a rad window half way down the page. Opens fine, now if i go to click+drag the window it disappears in a way. What happens is when i go to drag it, it places itself at the very top of the page (where i can no longer see since i've scrolled down). If i let go i can scroll up and find the window. Any ideas?

-Brian
George
Telerik team
 answered on 22 Apr 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?