textbox values

13 posts, 0 answers
  1. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 21 Dec 2012 Link to this post

    I have a radwindow with 2 text boxes, when the submit button is clicked i notice neither of the textboxes on this page show the values that have been entered.

    both show as empty.

    how do i get these values?

    it works when the form is within a normal asp.net page so its presumably due to the radwindow scenario.
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 21 Dec 2012 Link to this post

    Hello Mark,

    Is the submit you are talking about in the RadWindow or outside the RadWindow? If it's outside the RadWIndow, then it's expected that the textbox values become blank after it's clicked.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 21 Dec 2012 Link to this post

    the submit button is in the radwindow

    im trying to get the values in the code behind page from which it was launched
  5. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 21 Dec 2012 Link to this post

    What does your RadWindow page markup look like, because I tried it on my end it works correctly. I just want to clarify, when you submit the form, is it clearing the textboxes or are not able to retrieve the value from the textboxes in the code-behind?
  6. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 24 Dec 2012 Link to this post

    here is my radwindow code:
    <telerik:RadWindow ID="uxEditResult" runat="server" Width="475px">
            <ContentTemplate>       
                <div style="padding:15px">
                    <fieldset>
                        <legend>Edit test result</legend>
                        <label><asp:Literal  runat="server" ID="ResultValueName" /> (<asp:Literal runat="server" ID="Units" />)<asp:textbox ID="Result" runat="server" /></label>               
                        <span id="IndexBasedResult" runat="server"><label>Index<asp:TextBox runat="server" ID="Index" /></label></span>     
                    </fieldset>          
                    <div style="padding:30px;">
                        <asp:ImageButton runat="server" ImageUrl="~/image?button=OK" ID="OK" />
                        <asp:ImageButton runat="server" ImageUrl="~/image?button=Close" ID="Close" />
                    </div>  
                </div>
            </ContentTemplate>
        </telerik:RadWindow>

    I then use this code in the code behind page to get the values in textboxes - Result and Index - but both are empty, not showing the values that are typed in the boxes prior to clicking ok.

    Dim item = DirectCast(uxResults.SelectedItems(0), GridDataItem)      
            item("Value").Text = Result.Text
            item("Index").Text = Index.Text
            TryClose(sender, e)






  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Dec 2012 Link to this post

    Hi Mark,

    Here is the full code that I tried based on your scenario which works as expected.

    ASPX:
    <telerik:RadWindow ID="uxEditResult" runat="server" Width="475px" VisibleOnPageLoad="true">
            <ContentTemplate>     
                <div style="padding:15px">
                    <fieldset>
                        <legend>Edit test result</legend>
                        <label><asp:Literal  runat="server" ID="ResultValueName" /> (<asp:Literal runat="server" ID="Units" />)<asp:textbox ID="Result" runat="server" /></label>             
                        <span id="IndexBasedResult" runat="server"><label>Index<asp:TextBox runat="server" ID="Index" /></label></span>   
                    </fieldset>        
                    <div style="padding:30px;">
                        <asp:ImageButton runat="server" ImageUrl="~/Images/bullet5.jpg" ID="OK" OnClick="OK_Click" />
                        <asp:ImageButton runat="server" ImageUrl="~/Images/bullet5.jpg" ID="Close" />
                    </div>
                </div>
            </ContentTemplate>
    </telerik:RadWindow>

    VB:
    Protected Sub OK_Click(sender As Object, e As ImageClickEventArgs)
        Dim ind As String = Index.Text
        Dim res As String = Result.Text
    End Sub

    Thanks,
    Princy.
  8. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 27 Dec 2012 Link to this post

    thanks, thats effectively the code im using but both text box values are empty strings.

    you have the OK method in a separate page, not the window?

  9. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Dec 2012 Link to this post

    Hi Mark,

    Here is the full code that I tried.

    RadWindow.aspx
    <telerik:RadWindow ID="uxEditResult" runat="server" Width="475px" VisibleOnPageLoad="true">
            <ContentTemplate>      
                <div style="padding:15px">
                    <fieldset>
                        <legend>Edit test result</legend>
                        <label><asp:Literal  runat="server" ID="ResultValueName" /> (<asp:Literal runat="server" ID="Units" />)<asp:textbox ID="Result" runat="server" /></label>              
                        <span id="IndexBasedResult" runat="server"><label>Index<asp:TextBox runat="server" ID="Index" /></label></span>    
                    </fieldset>         
                    <div style="padding:30px;">
                        <asp:ImageButton runat="server" ImageUrl="~/Images/bullet5.jpg" ID="OK" OnClick="OK_Click" />
                        <asp:ImageButton runat="server" ImageUrl="~/Images/bullet5.jpg" ID="Close" />
                    </div
                </div>
            </ContentTemplate>
    </telerik:RadWindow>

    RadWindow.aspx.vb
    Protected Sub OK_Click(sender As Object, e As ImageClickEventArgs)
        Dim ind As String = Index.Text
        Dim res As String = Result.Text
    End Sub

    Hope this helps.

    Thanks,
    Princy.
  10. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 27 Dec 2012 Link to this post

    yes i see but what im wanting to do is get the values from the page that launches the window NOT the window itself...

    Clicking OK in the window fires a method in the page that launches the window...

    so i must not be targetting the textbox values correctly as this code doesnt work in this scenario. (values empty)
  11. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Dec 2012 Link to this post

    Hi Mark,

    I suppose you need to access RadTextboxes from the child page. Here is the code that I tried.

    RadWindow.aspx

    <telerik:RadWindow ID="uxEditResult" runat="server" Width="475px" VisibleOnPageLoad="true" NavigateUrl="ChildPage.aspx" >
    </telerik:RadWindow>

    ChildPage.aspx

    ASPX:
    <div style="padding:15px">
                    <fieldset>
                        <legend>Edit test result</legend>
                        <label><asp:Literal  runat="server" ID="ResultValueName" /> (<asp:Literal runat="server" ID="Units" />)<asp:textbox ID="Result" runat="server" /></label>              
                        <span id="IndexBasedResult" runat="server"><label>Index<asp:TextBox runat="server" ID="Index" /></label></span>    
                    </fieldset>         
                    <div style="padding:30px;">
                        <asp:ImageButton runat="server" ImageUrl="~/Images/bullet5.jpg" ID="OK" OnClick="OK_Click" />
                        <asp:ImageButton runat="server" ImageUrl="~/Images/bullet5.jpg" ID="Close" />
                    </div
    </div>

    VB:
    Protected Sub OK_Click(sender As Object, e As ImageClickEventArgs)
        Dim ind As String = Index.Text
        Dim res As String = Result.Text
    End Sub

    Hope this helps.

    Thanks,
    Princy.
  12. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 28 Dec 2012 Link to this post

    hi

    this is my scenario...

    i have a page where a window is launched when a row is clicked... its the window that has the textboxes in and when values are entered and button clicked i want to get the textbox values in the parent page it was launched from...

    Private Sub ResultClicked(sender As Object, e As EventArgs) Handles uxResults.ItemCommand
     
            uxEditResult.Show()
            Dim item = DirectCast(uxResults.SelectedItems(0), GridDataItem)
     
            ResultValueName.Text = item("Name").Text
            Result.Text = item("Value").Text
            Units.Text = item("Units").Text
            Index.Text = item("Index").Text
     
            IndexBasedResult.Visible = Not String.IsNullOrEmpty(Units.Text.UnencodedText())
        End Sub
     
    Private Sub TryOK(sender As Object, e As EventArgs) Handles OK.Click
     
            Dim item = DirectCast(uxResults.SelectedItems(0), GridDataItem)     
     
            item("Value").Text = Result.Text
            item("Index").Text = Index.Text
     
            TryClose(sender, e)
     
        End Sub

    <telerik:RadWindow ID="uxEditResult" runat="server" Width="475px">   
            <ContentTemplate>       
                <div style="padding:15px">
                    <fieldset>
                        <legend>Edit test result</legend>
                        <label><asp:Literal  runat="server" ID="ResultValueName" /> (<asp:Literal runat="server" ID="Units" />)<asp:textbox ID="Result" runat="server" /></label>               
                        <span id="IndexBasedResult" runat="server"><label>Index<asp:TextBox runat="server" ID="Index" /></label></span>     
                    </fieldset>           
                    <div style="padding:30px;">
                        <asp:ImageButton runat="server" ImageUrl="~/image?button=OK" ID="OK" />
                        <asp:ImageButton runat="server" ImageUrl="~/image?button=Close" ID="Close" />
                    </div>  
                </div>
            </ContentTemplate>
        </telerik:RadWindow>
  13. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Jan 2013 Link to this post

    Hi,

    I am not quite sure about your requirement. Here is the full code that I tried to retrieve the new value in textbox of the radwindow.
    aspx:
    <telerik:RadWindow ID="RadWindow1" runat="server">
      <ContentTemplate>
       <asp:TextBox ID="txt1" runat="server" />
       <asp:Button ID="Save" runat="server" Text="Save" onclick="Save_Click" />
      </ContentTemplate>
    </telerik:RadWindow>
    JS:
    function OnRowClick(sender, args) {
      var masterTable = sender.get_masterTableView();
            var row = masterTable.get_dataItems()[args.get_itemIndexHierarchical()];
            var cell = masterTable.getCellByColumnUniqueName(row, "OrderID");
            var wind = $find("RadWindow1");
            wind.show();//Opening radwindow
            $get("<%= txt1.ClientID %>").value = cell.innerHTML;//showing the value in textbox of radwindow
        }
    VB:
    Protected Sub Save_Click(sender As Object, e As EventArgs)
        Dim txt As TextBox = DirectCast(RadWindow1.ContentContainer.FindControl("txt1"), TextBox)
        Dim value As String = txt.Text
    End Sub

    Thanks,
    Princy.
  14. Mark
    Mark avatar
    30 posts
    Member since:
    Jan 2012

    Posted 04 Jan 2013 Link to this post

    thanks,

    this helped sort it, though there was also another issue affecting it that i spotted...

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017