need introduced value in detailsview in code-behind
am 22.04.2008 21:36:32 von Bob
Hi,
the detailsview (default mode = insert) is used to introduce names into the
database.
I need in code-behind the introduced name. I tried this:
code-behind:
-------------
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetailsView1.DataBound
dim lol as string
lol = DetailsView1.Rows(0).Cells(1).Text
Response.Write(lol)
End Sub
but this gives nothing.
Ant idea how to get the introduced name in code-behind?
Thanks
Bob
RE: need introduced value in detailsview in code-behind
am 23.04.2008 16:26:04 von Manish
Hi bob,
I m not able to repplicate the issue. I am getting the desired output. I
tried the same code that you are using. Please find my aspx page.
DataKeyNames="CategoryID"
DataSourceID="SqlDataSource1" Height="50px" Style="position:
static" Width="125px">
HeaderText="CategoryID" InsertVisible="False"
ReadOnly="True" SortExpression="CategoryID" />
HeaderText="CategoryName" SortExpression="CategoryName" />
HeaderText="Description" SortExpression="Description" />
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetailsView1.DataBound
Dim lol As String
lol = DetailsView1.Rows(0).Cells(1).Text
Response.Write(lol)
End Sub
I am getting the text from the 1st column in row 0.
Regards,
Manish
www.ComponentOne.com
"bob" wrote:
> Hi,
>
> the detailsview (default mode = insert) is used to introduce names into the
> database.
> I need in code-behind the introduced name. I tried this:
>
>
>
>
>
>
>
>
>
>
> code-behind:
> -------------
> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles DetailsView1.DataBound
> dim lol as string
> lol = DetailsView1.Rows(0).Cells(1).Text
> Response.Write(lol)
>
> End Sub
>
>
> but this gives nothing.
>
> Ant idea how to get the introduced name in code-behind?
> Thanks
> Bob
>
>
>
Re: need introduced value in detailsview in code-behind
am 24.04.2008 11:32:58 von Chris
Thanks for replying, but i still get nothing.
What do you get?
i tried this: DetailsView1.Rows(0).Cells(0).Text
but this gives me the headertext ("name") of the field and not the entered
value.
What i want is what the user types into the textbox embedded into the
detailsview.
But now i was thinking: is it not to early to use DetailsView1_DataBound,
because at that stage, nothing is entered into the textbox of the
detailsview?
???
"Manish" schreef in bericht
news:F52DACB2-790F-4D0D-82BF-EEE438BD746A@microsoft.com...
> Hi bob,
>
> I m not able to repplicate the issue. I am getting the desired output. I
> tried the same code that you are using. Please find my aspx page.
>
>
> DataKeyNames="CategoryID"
> DataSourceID="SqlDataSource1" Height="50px" Style="position:
> static" Width="125px">
>
>
> HeaderText="CategoryID" InsertVisible="False"
> ReadOnly="True" SortExpression="CategoryID" />
>
> HeaderText="CategoryName" SortExpression="CategoryName" />
>
> HeaderText="Description" SortExpression="Description" />
>
>
>
>
> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles DetailsView1.DataBound
> Dim lol As String
> lol = DetailsView1.Rows(0).Cells(1).Text
> Response.Write(lol)
> End Sub
>
> I am getting the text from the 1st column in row 0.
>
> Regards,
> Manish
> www.ComponentOne.com
>
> "bob" wrote:
>
>> Hi,
>>
>> the detailsview (default mode = insert) is used to introduce names into
>> the
>> database.
>> I need in code-behind the introduced name. I tried this:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> code-behind:
>> -------------
>> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles DetailsView1.DataBound
>> dim lol as string
>> lol = DetailsView1.Rows(0).Cells(1).Text
>> Response.Write(lol)
>>
>> End Sub
>>
>>
>> but this gives nothing.
>>
>> Ant idea how to get the introduced name in code-behind?
>> Thanks
>> Bob
>>
>>
>>