Home All Groups Group Topic Archive Search About

Getting value from FormView

Author
25 Aug 2006 7:50 PM
BB
Hi,
     I am using FormView Contol, TextBox (Hidden ) and Submit button
whose caption is "View Page" in my aspx page.
    Here is what I am tryin to do.When page loads I generate dynamic
url in text box . I want to append exisitng value in Formview field
"CustomeID" to url. When userclicks on "view page" ,new window is
opened with dynamic url.

   I am able to do generarting url dynamically, but dont know how i can
do rest of the things. Any idea?

       <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
CellPadding="4" DataKeyNames="CustomerID"
            DataSourceID="AccessDataSource1" ForeColor="#333333"
OnDataBound="FormView1_DataBound">
            <FooterStyle BackColor="#507CD1" Font-Bold="True"
ForeColor="White" />
            <EditRowStyle BackColor="#C0FFC0" />
            <EditItemTemplate>
                <table>
                    <tr>
                        <td style="width: 344px">
                            <span style="font-size:
9pt"><strong>ID:</strong></span></td>
                        <td colspan="2">
                <asp:Label ID="IDLabel1" runat="server" Text='<%#
Eval("CustomerID") %>' Font-Names="Arial"
Font-Size="8pt"></asp:Label></td>
                    </tr>
                    <tr>.....

               How I can get value of "IDLabel1" may be in page load or
databound event of page? so that I can concanate value of IDLabel1 to
my url


Thank you

Author
29 Aug 2006 2:48 AM
KJ
After you have databound the fomview, using the following style of
coding to get the value of IDLabel1:

Label IDLabel1 = (Label)FormView1.FindControl("FormView1");
string MyValue = IDLabel1.Text;

BB wrote:
Show quoteHide quote
> Hi,
>      I am using FormView Contol, TextBox (Hidden ) and Submit button
> whose caption is "View Page" in my aspx page.
>     Here is what I am tryin to do.When page loads I generate dynamic
> url in text box . I want to append exisitng value in Formview field
> "CustomeID" to url. When userclicks on "view page" ,new window is
> opened with dynamic url.
>
>    I am able to do generarting url dynamically, but dont know how i can
> do rest of the things. Any idea?
>
>        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
> CellPadding="4" DataKeyNames="CustomerID"
>             DataSourceID="AccessDataSource1" ForeColor="#333333"
> OnDataBound="FormView1_DataBound">
>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
> ForeColor="White" />
>             <EditRowStyle BackColor="#C0FFC0" />
>             <EditItemTemplate>
>                 <table>
>                     <tr>
>                         <td style="width: 344px">
>                             <span style="font-size:
> 9pt"><strong>ID:</strong></span></td>
>                         <td colspan="2">
>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
> Eval("CustomerID") %>' Font-Names="Arial"
> Font-Size="8pt"></asp:Label></td>
>                     </tr>
>                     <tr>.....
>
>                How I can get value of "IDLabel1" may be in page load or
> databound event of page? so that I can concanate value of IDLabel1 to
> my url
>
>
> Thank you
Are all your drivers up to date? click for free checkup

Author
29 Aug 2006 2:48 AM
KJ
Sorry, I screwed up the first code line, it should be:

Label IDLabel1 = (Label)FormView1.FindControl("IDLabel1");

BB wrote:
Show quoteHide quote
> Hi,
>      I am using FormView Contol, TextBox (Hidden ) and Submit button
> whose caption is "View Page" in my aspx page.
>     Here is what I am tryin to do.When page loads I generate dynamic
> url in text box . I want to append exisitng value in Formview field
> "CustomeID" to url. When userclicks on "view page" ,new window is
> opened with dynamic url.
>
>    I am able to do generarting url dynamically, but dont know how i can
> do rest of the things. Any idea?
>
>        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
> CellPadding="4" DataKeyNames="CustomerID"
>             DataSourceID="AccessDataSource1" ForeColor="#333333"
> OnDataBound="FormView1_DataBound">
>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
> ForeColor="White" />
>             <EditRowStyle BackColor="#C0FFC0" />
>             <EditItemTemplate>
>                 <table>
>                     <tr>
>                         <td style="width: 344px">
>                             <span style="font-size:
> 9pt"><strong>ID:</strong></span></td>
>                         <td colspan="2">
>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
> Eval("CustomerID") %>' Font-Names="Arial"
> Font-Size="8pt"></asp:Label></td>
>                     </tr>
>                     <tr>.....
>
>                How I can get value of "IDLabel1" may be in page load or
> databound event of page? so that I can concanate value of IDLabel1 to
> my url
>
>
> Thank you
Author
29 Aug 2006 5:09 PM
BB
Hi,

   Thank you for your response. Here is what I did...

Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim sLabel As WebControls.Label

sLabel = FormView1.FindControl("IDLabel1")
TextBox1.Text = TextBox1.Text & sLabel.Text
End Sub

I get following error...Any Idea?

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

Line 19:         sLabel = FormView1.FindControl("IDLabel1")
Line 20:         TextBox1.Text = TextBox1.Text & sLabel.Text
Line 21:     End Sub
Line 22: </script>


Thamk you

Show quoteHide quote
"KJ" <n_o_s_p_a***@mail.com> wrote in message
news:1156819738.936916.169720@p79g2000cwp.googlegroups.com...
> Sorry, I screwed up the first code line, it should be:
>
> Label IDLabel1 = (Label)FormView1.FindControl("IDLabel1");
>
> BB wrote:
>> Hi,
>>      I am using FormView Contol, TextBox (Hidden ) and Submit button
>> whose caption is "View Page" in my aspx page.
>>     Here is what I am tryin to do.When page loads I generate dynamic
>> url in text box . I want to append exisitng value in Formview field
>> "CustomeID" to url. When userclicks on "view page" ,new window is
>> opened with dynamic url.
>>
>>    I am able to do generarting url dynamically, but dont know how i can
>> do rest of the things. Any idea?
>>
>>        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
>> CellPadding="4" DataKeyNames="CustomerID"
>>             DataSourceID="AccessDataSource1" ForeColor="#333333"
>> OnDataBound="FormView1_DataBound">
>>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
>> ForeColor="White" />
>>             <EditRowStyle BackColor="#C0FFC0" />
>>             <EditItemTemplate>
>>                 <table>
>>                     <tr>
>>                         <td style="width: 344px">
>>                             <span style="font-size:
>> 9pt"><strong>ID:</strong></span></td>
>>                         <td colspan="2">
>>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
>> Eval("CustomerID") %>' Font-Names="Arial"
>> Font-Size="8pt"></asp:Label></td>
>>                     </tr>
>>                     <tr>.....
>>
>>                How I can get value of "IDLabel1" may be in page load or
>> databound event of page? so that I can concanate value of IDLabel1 to
>> my url
>>
>>
>> Thank you
>
Author
29 Aug 2006 6:34 PM
KJ
Now I see.

In the DataBound method, you can use the Row property of FormView1 to
programmatically access the FormViewRow object that represents the
current data row.

The data row contains different content based on the template that is
rendered for the current mode (specified by the CurrentMode property).

You can only access the contents of the template for the current mode.
This means that you will only be able to find IDLabel1 using this
technique if the FormView1 is in Edit mode (e.g., using the
EditItemTemplate containing IDLabel1).

Check FormView1.CurrentMode and see what you come up with. If the value
is not FormViewMode.Edit, you cannot get the IDLabel1.


BB wrote:
Show quoteHide quote
> Hi,
>
>    Thank you for your response. Here is what I did...
>
> Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
> System.EventArgs)
> Dim sLabel As WebControls.Label
>
> sLabel = FormView1.FindControl("IDLabel1")
> TextBox1.Text = TextBox1.Text & sLabel.Text
> End Sub
>
> I get following error...Any Idea?
>
> Object reference not set to an instance of an object.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.NullReferenceException: Object reference not set
> to an instance of an object.
>
> Source Error:
>
> Line 19:         sLabel = FormView1.FindControl("IDLabel1")
> Line 20:         TextBox1.Text = TextBox1.Text & sLabel.Text
> Line 21:     End Sub
> Line 22: </script>
>
>
> Thamk you
>
> "KJ" <n_o_s_p_a***@mail.com> wrote in message
> news:1156819738.936916.169720@p79g2000cwp.googlegroups.com...
> > Sorry, I screwed up the first code line, it should be:
> >
> > Label IDLabel1 = (Label)FormView1.FindControl("IDLabel1");
> >
> > BB wrote:
> >> Hi,
> >>      I am using FormView Contol, TextBox (Hidden ) and Submit button
> >> whose caption is "View Page" in my aspx page.
> >>     Here is what I am tryin to do.When page loads I generate dynamic
> >> url in text box . I want to append exisitng value in Formview field
> >> "CustomeID" to url. When userclicks on "view page" ,new window is
> >> opened with dynamic url.
> >>
> >>    I am able to do generarting url dynamically, but dont know how i can
> >> do rest of the things. Any idea?
> >>
> >>        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
> >> CellPadding="4" DataKeyNames="CustomerID"
> >>             DataSourceID="AccessDataSource1" ForeColor="#333333"
> >> OnDataBound="FormView1_DataBound">
> >>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
> >> ForeColor="White" />
> >>             <EditRowStyle BackColor="#C0FFC0" />
> >>             <EditItemTemplate>
> >>                 <table>
> >>                     <tr>
> >>                         <td style="width: 344px">
> >>                             <span style="font-size:
> >> 9pt"><strong>ID:</strong></span></td>
> >>                         <td colspan="2">
> >>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
> >> Eval("CustomerID") %>' Font-Names="Arial"
> >> Font-Size="8pt"></asp:Label></td>
> >>                     </tr>
> >>                     <tr>.....
> >>
> >>                How I can get value of "IDLabel1" may be in page load or
> >> databound event of page? so that I can concanate value of IDLabel1 to
> >> my url
> >>
> >>
> >> Thank you
> >
Author
29 Aug 2006 7:30 PM
BB
Well...Logic behind this is ...
         When page is loaded I create link in text box which is invisible. I
have "Preview" button when user click it , It takes url from invisible text
box and goes to that link. Now when form is loaded. IDLabel1 value is
already there displayed. I just need to take that vale and pass as
querystring. ..like ...?iGroup=IDLabel1.text
        User interface will be...
         User open this form. Selects record to edit using previous next
link buttons on FormView.then Click edit . Make necessary changes. Save
changes. and click on "Preview" button.

Any idea how I acheive this?

Show quoteHide quote
"KJ" <n_o_s_p_a***@mail.com> wrote in message
news:1156876493.743667.180500@h48g2000cwc.googlegroups.com...
> Now I see.
>
> In the DataBound method, you can use the Row property of FormView1 to
> programmatically access the FormViewRow object that represents the
> current data row.
>
> The data row contains different content based on the template that is
> rendered for the current mode (specified by the CurrentMode property).
>
> You can only access the contents of the template for the current mode.
> This means that you will only be able to find IDLabel1 using this
> technique if the FormView1 is in Edit mode (e.g., using the
> EditItemTemplate containing IDLabel1).
>
> Check FormView1.CurrentMode and see what you come up with. If the value
> is not FormViewMode.Edit, you cannot get the IDLabel1.
>
>
> BB wrote:
>> Hi,
>>
>>    Thank you for your response. Here is what I did...
>>
>> Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
>> System.EventArgs)
>> Dim sLabel As WebControls.Label
>>
>> sLabel = FormView1.FindControl("IDLabel1")
>> TextBox1.Text = TextBox1.Text & sLabel.Text
>> End Sub
>>
>> I get following error...Any Idea?
>>
>> Object reference not set to an instance of an object.
>> Description: An unhandled exception occurred during the execution of the
>> current web request. Please review the stack trace for more information
>> about the error and where it originated in the code.
>>
>> Exception Details: System.NullReferenceException: Object reference not
>> set
>> to an instance of an object.
>>
>> Source Error:
>>
>> Line 19:         sLabel = FormView1.FindControl("IDLabel1")
>> Line 20:         TextBox1.Text = TextBox1.Text & sLabel.Text
>> Line 21:     End Sub
>> Line 22: </script>
>>
>>
>> Thamk you
>>
>> "KJ" <n_o_s_p_a***@mail.com> wrote in message
>> news:1156819738.936916.169720@p79g2000cwp.googlegroups.com...
>> > Sorry, I screwed up the first code line, it should be:
>> >
>> > Label IDLabel1 = (Label)FormView1.FindControl("IDLabel1");
>> >
>> > BB wrote:
>> >> Hi,
>> >>      I am using FormView Contol, TextBox (Hidden ) and Submit button
>> >> whose caption is "View Page" in my aspx page.
>> >>     Here is what I am tryin to do.When page loads I generate dynamic
>> >> url in text box . I want to append exisitng value in Formview field
>> >> "CustomeID" to url. When userclicks on "view page" ,new window is
>> >> opened with dynamic url.
>> >>
>> >>    I am able to do generarting url dynamically, but dont know how i
>> >> can
>> >> do rest of the things. Any idea?
>> >>
>> >>        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
>> >> CellPadding="4" DataKeyNames="CustomerID"
>> >>             DataSourceID="AccessDataSource1" ForeColor="#333333"
>> >> OnDataBound="FormView1_DataBound">
>> >>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
>> >> ForeColor="White" />
>> >>             <EditRowStyle BackColor="#C0FFC0" />
>> >>             <EditItemTemplate>
>> >>                 <table>
>> >>                     <tr>
>> >>                         <td style="width: 344px">
>> >>                             <span style="font-size:
>> >> 9pt"><strong>ID:</strong></span></td>
>> >>                         <td colspan="2">
>> >>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
>> >> Eval("CustomerID") %>' Font-Names="Arial"
>> >> Font-Size="8pt"></asp:Label></td>
>> >>                     </tr>
>> >>                     <tr>.....
>> >>
>> >>                How I can get value of "IDLabel1" may be in page load
>> >> or
>> >> databound event of page? so that I can concanate value of IDLabel1 to
>> >> my url
>> >>
>> >>
>> >> Thank you
>> >
>
Author
31 Aug 2006 10:16 PM
KJ
I'm a little confused: are you saying that the value of IDLabel1 is
never changed by the user?

BB wrote:
Show quoteHide quote
> Well...Logic behind this is ...
>          When page is loaded I create link in text box which is invisible. I
> have "Preview" button when user click it , It takes url from invisible text
> box and goes to that link. Now when form is loaded. IDLabel1 value is
> already there displayed. I just need to take that vale and pass as
> querystring. ..like ...?iGroup=IDLabel1.text
>         User interface will be...
>          User open this form. Selects record to edit using previous next
> link buttons on FormView.then Click edit . Make necessary changes. Save
> changes. and click on "Preview" button.
>
> Any idea how I acheive this?
>
> "KJ" <n_o_s_p_a***@mail.com> wrote in message
> news:1156876493.743667.180500@h48g2000cwc.googlegroups.com...
> > Now I see.
> >
> > In the DataBound method, you can use the Row property of FormView1 to
> > programmatically access the FormViewRow object that represents the
> > current data row.
> >
> > The data row contains different content based on the template that is
> > rendered for the current mode (specified by the CurrentMode property).
> >
> > You can only access the contents of the template for the current mode.
> > This means that you will only be able to find IDLabel1 using this
> > technique if the FormView1 is in Edit mode (e.g., using the
> > EditItemTemplate containing IDLabel1).
> >
> > Check FormView1.CurrentMode and see what you come up with. If the value
> > is not FormViewMode.Edit, you cannot get the IDLabel1.
> >
> >
> > BB wrote:
> >> Hi,
> >>
> >>    Thank you for your response. Here is what I did...
> >>
> >> Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
> >> System.EventArgs)
> >> Dim sLabel As WebControls.Label
> >>
> >> sLabel = FormView1.FindControl("IDLabel1")
> >> TextBox1.Text = TextBox1.Text & sLabel.Text
> >> End Sub
> >>
> >> I get following error...Any Idea?
> >>
> >> Object reference not set to an instance of an object.
> >> Description: An unhandled exception occurred during the execution of the
> >> current web request. Please review the stack trace for more information
> >> about the error and where it originated in the code.
> >>
> >> Exception Details: System.NullReferenceException: Object reference not
> >> set
> >> to an instance of an object.
> >>
> >> Source Error:
> >>
> >> Line 19:         sLabel = FormView1.FindControl("IDLabel1")
> >> Line 20:         TextBox1.Text = TextBox1.Text & sLabel.Text
> >> Line 21:     End Sub
> >> Line 22: </script>
> >>
> >>
> >> Thamk you
> >>
> >> "KJ" <n_o_s_p_a***@mail.com> wrote in message
> >> news:1156819738.936916.169720@p79g2000cwp.googlegroups.com...
> >> > Sorry, I screwed up the first code line, it should be:
> >> >
> >> > Label IDLabel1 = (Label)FormView1.FindControl("IDLabel1");
> >> >
> >> > BB wrote:
> >> >> Hi,
> >> >>      I am using FormView Contol, TextBox (Hidden ) and Submit button
> >> >> whose caption is "View Page" in my aspx page.
> >> >>     Here is what I am tryin to do.When page loads I generate dynamic
> >> >> url in text box . I want to append exisitng value in Formview field
> >> >> "CustomeID" to url. When userclicks on "view page" ,new window is
> >> >> opened with dynamic url.
> >> >>
> >> >>    I am able to do generarting url dynamically, but dont know how i
> >> >> can
> >> >> do rest of the things. Any idea?
> >> >>
> >> >>        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
> >> >> CellPadding="4" DataKeyNames="CustomerID"
> >> >>             DataSourceID="AccessDataSource1" ForeColor="#333333"
> >> >> OnDataBound="FormView1_DataBound">
> >> >>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
> >> >> ForeColor="White" />
> >> >>             <EditRowStyle BackColor="#C0FFC0" />
> >> >>             <EditItemTemplate>
> >> >>                 <table>
> >> >>                     <tr>
> >> >>                         <td style="width: 344px">
> >> >>                             <span style="font-size:
> >> >> 9pt"><strong>ID:</strong></span></td>
> >> >>                         <td colspan="2">
> >> >>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
> >> >> Eval("CustomerID") %>' Font-Names="Arial"
> >> >> Font-Size="8pt"></asp:Label></td>
> >> >>                     </tr>
> >> >>                     <tr>.....
> >> >>
> >> >>                How I can get value of "IDLabel1" may be in page load
> >> >> or
> >> >> databound event of page? so that I can concanate value of IDLabel1 to
> >> >> my url
> >> >>
> >> >>
> >> >> Thank you
> >> >
> >
Author
31 Aug 2006 11:02 PM
BB
Yes..Since its a label. User cannot change value. He can edit other fields
but not IDLabel1..


Show quoteHide quote
"KJ" <n_o_s_p_a***@mail.com> wrote in message
news:1157062613.431590.242120@m73g2000cwd.googlegroups.com...
> I'm a little confused: are you saying that the value of IDLabel1 is
> never changed by the user?
>
> BB wrote:
>> Well...Logic behind this is ...
>>          When page is loaded I create link in text box which is
>> invisible. I
>> have "Preview" button when user click it , It takes url from invisible
>> text
>> box and goes to that link. Now when form is loaded. IDLabel1 value is
>> already there displayed. I just need to take that vale and pass as
>> querystring. ..like ...?iGroup=IDLabel1.text
>>         User interface will be...
>>          User open this form. Selects record to edit using previous next
>> link buttons on FormView.then Click edit . Make necessary changes. Save
>> changes. and click on "Preview" button.
>>
>> Any idea how I acheive this?
>>
>> "KJ" <n_o_s_p_a***@mail.com> wrote in message
>> news:1156876493.743667.180500@h48g2000cwc.googlegroups.com...
>> > Now I see.
>> >
>> > In the DataBound method, you can use the Row property of FormView1 to
>> > programmatically access the FormViewRow object that represents the
>> > current data row.
>> >
>> > The data row contains different content based on the template that is
>> > rendered for the current mode (specified by the CurrentMode property).
>> >
>> > You can only access the contents of the template for the current mode.
>> > This means that you will only be able to find IDLabel1 using this
>> > technique if the FormView1 is in Edit mode (e.g., using the
>> > EditItemTemplate containing IDLabel1).
>> >
>> > Check FormView1.CurrentMode and see what you come up with. If the value
>> > is not FormViewMode.Edit, you cannot get the IDLabel1.
>> >
>> >
>> > BB wrote:
>> >> Hi,
>> >>
>> >>    Thank you for your response. Here is what I did...
>> >>
>> >> Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
>> >> System.EventArgs)
>> >> Dim sLabel As WebControls.Label
>> >>
>> >> sLabel = FormView1.FindControl("IDLabel1")
>> >> TextBox1.Text = TextBox1.Text & sLabel.Text
>> >> End Sub
>> >>
>> >> I get following error...Any Idea?
>> >>
>> >> Object reference not set to an instance of an object.
>> >> Description: An unhandled exception occurred during the execution of
>> >> the
>> >> current web request. Please review the stack trace for more
>> >> information
>> >> about the error and where it originated in the code.
>> >>
>> >> Exception Details: System.NullReferenceException: Object reference not
>> >> set
>> >> to an instance of an object.
>> >>
>> >> Source Error:
>> >>
>> >> Line 19:         sLabel = FormView1.FindControl("IDLabel1")
>> >> Line 20:         TextBox1.Text = TextBox1.Text & sLabel.Text
>> >> Line 21:     End Sub
>> >> Line 22: </script>
>> >>
>> >>
>> >> Thamk you
>> >>
>> >> "KJ" <n_o_s_p_a***@mail.com> wrote in message
>> >> news:1156819738.936916.169720@p79g2000cwp.googlegroups.com...
>> >> > Sorry, I screwed up the first code line, it should be:
>> >> >
>> >> > Label IDLabel1 = (Label)FormView1.FindControl("IDLabel1");
>> >> >
>> >> > BB wrote:
>> >> >> Hi,
>> >> >>      I am using FormView Contol, TextBox (Hidden ) and Submit
>> >> >> button
>> >> >> whose caption is "View Page" in my aspx page.
>> >> >>     Here is what I am tryin to do.When page loads I generate
>> >> >> dynamic
>> >> >> url in text box . I want to append exisitng value in Formview field
>> >> >> "CustomeID" to url. When userclicks on "view page" ,new window is
>> >> >> opened with dynamic url.
>> >> >>
>> >> >>    I am able to do generarting url dynamically, but dont know how i
>> >> >> can
>> >> >> do rest of the things. Any idea?
>> >> >>
>> >> >>        <asp:FormView ID="FormView1" runat="server"
>> >> >> AllowPaging="True"
>> >> >> CellPadding="4" DataKeyNames="CustomerID"
>> >> >>             DataSourceID="AccessDataSource1" ForeColor="#333333"
>> >> >> OnDataBound="FormView1_DataBound">
>> >> >>             <FooterStyle BackColor="#507CD1" Font-Bold="True"
>> >> >> ForeColor="White" />
>> >> >>             <EditRowStyle BackColor="#C0FFC0" />
>> >> >>             <EditItemTemplate>
>> >> >>                 <table>
>> >> >>                     <tr>
>> >> >>                         <td style="width: 344px">
>> >> >>                             <span style="font-size:
>> >> >> 9pt"><strong>ID:</strong></span></td>
>> >> >>                         <td colspan="2">
>> >> >>                 <asp:Label ID="IDLabel1" runat="server" Text='<%#
>> >> >> Eval("CustomerID") %>' Font-Names="Arial"
>> >> >> Font-Size="8pt"></asp:Label></td>
>> >> >>                     </tr>
>> >> >>                     <tr>.....
>> >> >>
>> >> >>                How I can get value of "IDLabel1" may be in page
>> >> >> load
>> >> >> or
>> >> >> databound event of page? so that I can concanate value of IDLabel1
>> >> >> to
>> >> >> my url
>> >> >>
>> >> >>
>> >> >> Thank you
>> >> >
>> >
>
Author
10 Sep 2006 4:52 PM
Bob
Any ideas guys?


Show quoteHide quote
"BB" <shmil***@gmail.com> wrote in message
news:1156535439.408828.309710@74g2000cwt.googlegroups.com...
> Hi,
>     I am using FormView Contol, TextBox (Hidden ) and Submit button
> whose caption is "View Page" in my aspx page.
>    Here is what I am tryin to do.When page loads I generate dynamic
> url in text box . I want to append exisitng value in Formview field
> "CustomeID" to url. When userclicks on "view page" ,new window is
> opened with dynamic url.
>
>   I am able to do generarting url dynamically, but dont know how i can
> do rest of the things. Any idea?
>
>       <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
> CellPadding="4" DataKeyNames="CustomerID"
>            DataSourceID="AccessDataSource1" ForeColor="#333333"
> OnDataBound="FormView1_DataBound">
>            <FooterStyle BackColor="#507CD1" Font-Bold="True"
> ForeColor="White" />
>            <EditRowStyle BackColor="#C0FFC0" />
>            <EditItemTemplate>
>                <table>
>                    <tr>
>                        <td style="width: 344px">
>                            <span style="font-size:
> 9pt"><strong>ID:</strong></span></td>
>                        <td colspan="2">
>                <asp:Label ID="IDLabel1" runat="server" Text='<%#
> Eval("CustomerID") %>' Font-Names="Arial"
> Font-Size="8pt"></asp:Label></td>
>                    </tr>
>                    <tr>.....
>
>               How I can get value of "IDLabel1" may be in page load or
> databound event of page? so that I can concanate value of IDLabel1 to
> my url
>
>
> Thank you
>

Bookmark and Share