cross page posting using detailsview

Posted on 2007-07-30
Last Modified: 2008-01-09
Hi Experts.
I'd like some pointers with the following please?
I have tried to crosspage post from  a source page which has a detailsview with a "textbox template" field with no success.
Here is the code that i have attempted on the target page - it compiles ok, but what have i missed out?
Thanks for your help..

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            If Not Page.PreviousPage Is Nothing Then
            Dim SourceTextBox As TextBox
            SourceTextBox = CType(Page.PreviousPage.FindControl("TextBox1"), DetailsView).DataItem
            If Not SourceTextBox Is Nothing Then
                TextBox1.Text = SourceTextBox.Text
            End If
        End If
    End Sub
Question by:hyperviper
    LVL 22

    Accepted Solution

    You'll have to use FindControl on the DetailsView itself as the TextBox is containted inside the DetailsView. Something like this:

    SourceTextBox = CType(CType(Page.PreviousPage.FindControl("DetailsView1")).FindControl("TextBox1"), TextBox)
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now