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

RadTextBox text value is always empty string

1 Answer 358 Views
Input
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 12 Sep 2011, 05:26 AM
Details:
1 - Version 2011.2.712.40 of Telerik.Web.UI.
2 - Net 4.0 (therefore Visual Studio 2010).
3 - Development machine is Windows 7 Ultimate.
4 - Application pool is .Net 4.0 Integrated.

I have a simple login form (that uses a master page) with RadTextBoxes for username/password and a server-side button:

CONTENT.MASTER
<%@ master autoeventwireup="true" codebehind="content.master.cs" inherits="Administration.content" language="C#" %>
<!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>
          <title>Administration</title>
     </head>
     <body>
          <form id="frmFormCriteria" runat="server">
               <asp:contentplaceholder id="cphContent" runat="server" />
          </form>
     </body>
</html>

LOGIN.ASPX
<%@ page autoeventwireup="true" codebehind="login.aspx.cs" inherits="Administration.login" language="C#" masterpagefile="~/content.master" title="" %>
<%@ mastertype virtualpath="~/content.master" %>
<%@ register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:content contentplaceholderid="cphContent" runat="server">
     <telerik:radscriptmanager runat="server" />
     Username: <telerik:radtextbox emptymessage="[Please enter your username]" id="txtUsername" maxlength="255" textmode="SingleLine" width="200" runat="server" />
     Password: <asp:textbox id="txtPassword" maxlength="100" textmode="password" width="200" runat="server" />
     <asp:button id="btnSubmit" text="Login" runat="server" onclick="btnSubmit_Click" />
</asp:content>

When I click inside the username control, the empty message does not disappear.

While debugging, when I type enter the username and password then click the login button, the text value for both controls is an empty string.

If I change the RadTextBoxes to server-side TextBoxes the entered values are passed correctly.

What is even more frustrating, if I change the RadScriptManager to the asp:ScriptManager and leave the RadTextBoxes alone, EVERYTHING (including the empty message disappearing on focus) works correctly.

I must be doing something wrong, but what?!?

The web.config is also:

<?xml version="1.0"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
        <customErrors mode="Off" />
        <xhtmlConformance mode="Transitional" />
        <httpHandlers>
            <add verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
        </httpHandlers>
    </system.web>
    <system.web.extensions>
        <scripting>
            <webServices>
                <jsonSerialization maxJsonLength="5000000"/>
            </webServices>
        </scripting>
    </system.web.extensions>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <handlers>
            <add verb="*" name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode"/>
        </handlers>
    </system.webServer>
</configuration>

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 15 Sep 2011, 08:19 AM
Hi William,

In scenarios with master pages, the RadScriptManager should be placed on top of the master page and not in the content ones. So, try moving it to the master and let us know if this changes the textboxes' behavior.

All the best,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Input
Asked by
William
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or