Home All Groups Group Topic Archive Search About

EDITITEMTEMPLATE FINDCONTROL PROBLEM

Author
20 Jul 2006 8:53 AM
Savas Ates
My aim is  showing product availability   in a dropdown by checking the
database issues and let user to change its value...

The Error :
ideefixesatisc.DataTextField = "Stokta Yok"
Object reference not set to an instance of an object.


In my edit item template i have a dropdown like that

//////////////////////////////

My function

Public Function SelectMyIndex(ByVal indexno As Boolean)

Dim ideefixesatisc As New DropDownList

If indexno = True Then

ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Var"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(True))

End If

If indexno = False Then



ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)

ideefixesatisc.DataTextField = "Stokta Yok"

ideefixesatisc.SelectedIndex =
ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(False))



End If

End Function



<asp:DropDownList  Runat =server ID="CIdeefixeSatis" SelectedIndex='<%#
SelectMyIndex(DataBinder.Eval(Container, "DataItem.ideefixesatis")) %>' >

            <asp:ListItem  Value ="True" >Stokta Var</asp:ListItem>
                <asp:ListItem  Value ="False" >Stokta Yok</asp:ListItem>
</asp:DropDownList>


///////////////

Author
20 Jul 2006 9:05 AM
Cor Ligthert [MVP]
Savas,

Did you try it with the same cases for "CIdeefixeSatis". Identifiers as
strings are not a real part of the VBNet code and therefore (mostly) case
sensetive,

By the way, why did you sent this message to the newsgroup languages.csharp,
I don't see any C# code.

Cor

Show quoteHide quote
"Savas Ates" <in da club> schreef in bericht
news:erleHo9qGHA.1552@TK2MSFTNGP02.phx.gbl...
> My aim is  showing product availability   in a dropdown by checking the
> database issues and let user to change its value...
>
> The Error :
> ideefixesatisc.DataTextField = "Stokta Yok"
> Object reference not set to an instance of an object.
>
>
> In my edit item template i have a dropdown like that
>
> //////////////////////////////
>
> My function
>
> Public Function SelectMyIndex(ByVal indexno As Boolean)
>
> Dim ideefixesatisc As New DropDownList
>
> If indexno = True Then
>
> ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)
>
> ideefixesatisc.DataTextField = "Stokta Var"
>
> ideefixesatisc.SelectedIndex =
> ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(True))
>
> End If
>
> If indexno = False Then
>
>
>
> ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)
>
> ideefixesatisc.DataTextField = "Stokta Yok"
>
> ideefixesatisc.SelectedIndex =
> ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(False))
>
>
>
> End If
>
> End Function
>
>
>
> <asp:DropDownList  Runat =server ID="CIdeefixeSatis" SelectedIndex='<%#
> SelectMyIndex(DataBinder.Eval(Container, "DataItem.ideefixesatis")) %>' >
>
>            <asp:ListItem  Value ="True" >Stokta Var</asp:ListItem>
>                <asp:ListItem  Value ="False" >Stokta Yok</asp:ListItem>
> </asp:DropDownList>
>
>
> ///////////////
>
Author
20 Jul 2006 9:23 AM
Savas Ates
I didnt understand what you meant ? What you meant by saying
"CIdeefixeSatis" case ? How can i solve that problem ?


"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl>, haber iletisinde þunlarý
yazdý:u2HCxt9qGHA.4***@TK2MSFTNGP05.phx.gbl...
Show quoteHide quote
> Savas,
>
> Did you try it with the same cases for "CIdeefixeSatis". Identifiers as
> strings are not a real part of the VBNet code and therefore (mostly) case
> sensetive,
>
> By the way, why did you sent this message to the newsgroup
> languages.csharp, I don't see any C# code.
>
> Cor
>
> "Savas Ates" <in da club> schreef in bericht
> news:erleHo9qGHA.1552@TK2MSFTNGP02.phx.gbl...
>> My aim is  showing product availability   in a dropdown by checking the
>> database issues and let user to change its value...
>>
>> The Error :
>> ideefixesatisc.DataTextField = "Stokta Yok"
>> Object reference not set to an instance of an object.
>>
>>
>> In my edit item template i have a dropdown like that
>>
>> //////////////////////////////
>>
>> My function
>>
>> Public Function SelectMyIndex(ByVal indexno As Boolean)
>>
>> Dim ideefixesatisc As New DropDownList
>>
>> If indexno = True Then
>>
>> ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)
>>
>> ideefixesatisc.DataTextField = "Stokta Var"
>>
>> ideefixesatisc.SelectedIndex =
>> ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(True))
>>
>> End If
>>
>> If indexno = False Then
>>
>>
>>
>> ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)
>>
>> ideefixesatisc.DataTextField = "Stokta Yok"
>>
>> ideefixesatisc.SelectedIndex =
>> ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(False))
>>
>>
>>
>> End If
>>
>> End Function
>>
>>
>>
>> <asp:DropDownList  Runat =server ID="CIdeefixeSatis" SelectedIndex='<%#
>> SelectMyIndex(DataBinder.Eval(Container, "DataItem.ideefixesatis")) %>' >
>>
>>            <asp:ListItem  Value ="True" >Stokta Var</asp:ListItem>
>>                <asp:ListItem  Value ="False" >Stokta Yok</asp:ListItem>
>> </asp:DropDownList>
>>
>>
>> ///////////////
>>
>
>
Author
20 Jul 2006 9:27 AM
Cor Ligthert [MVP]
Savas,

You use Uper and Lower cases in that identifier mixed up.

Cor

Show quoteHide quote
"Savas Ates" <in da club> schreef in bericht
news:uy8pq49qGHA.4336@TK2MSFTNGP02.phx.gbl...
>I didnt understand what you meant ? What you meant by saying
>"CIdeefixeSatis" case ? How can i solve that problem ?
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl>, haber iletisinde þunlarý
> yazdý:u2HCxt9qGHA.4***@TK2MSFTNGP05.phx.gbl...
>> Savas,
>>
>> Did you try it with the same cases for "CIdeefixeSatis". Identifiers as
>> strings are not a real part of the VBNet code and therefore (mostly) case
>> sensetive,
>>
>> By the way, why did you sent this message to the newsgroup
>> languages.csharp, I don't see any C# code.
>>
>> Cor
>>
>> "Savas Ates" <in da club> schreef in bericht
>> news:erleHo9qGHA.1552@TK2MSFTNGP02.phx.gbl...
>>> My aim is  showing product availability   in a dropdown by checking the
>>> database issues and let user to change its value...
>>>
>>> The Error :
>>> ideefixesatisc.DataTextField = "Stokta Yok"
>>> Object reference not set to an instance of an object.
>>>
>>>
>>> In my edit item template i have a dropdown like that
>>>
>>> //////////////////////////////
>>>
>>> My function
>>>
>>> Public Function SelectMyIndex(ByVal indexno As Boolean)
>>>
>>> Dim ideefixesatisc As New DropDownList
>>>
>>> If indexno = True Then
>>>
>>> ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)
>>>
>>> ideefixesatisc.DataTextField = "Stokta Var"
>>>
>>> ideefixesatisc.SelectedIndex =
>>> ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(True))
>>>
>>> End If
>>>
>>> If indexno = False Then
>>>
>>>
>>>
>>> ideefixesatisc = CType(Page.FindControl("CIdeefixesatis"), DropDownList)
>>>
>>> ideefixesatisc.DataTextField = "Stokta Yok"
>>>
>>> ideefixesatisc.SelectedIndex =
>>> ideefixesatisc.Items.IndexOf(ideefixesatisc.Items.FindByValue(False))
>>>
>>>
>>>
>>> End If
>>>
>>> End Function
>>>
>>>
>>>
>>> <asp:DropDownList  Runat =server ID="CIdeefixeSatis" SelectedIndex='<%#
>>> SelectMyIndex(DataBinder.Eval(Container, "DataItem.ideefixesatis")) %>'
>>>  >
>>>
>>>            <asp:ListItem  Value ="True" >Stokta Var</asp:ListItem>
>>>                <asp:ListItem  Value ="False" >Stokta Yok</asp:ListItem>
>>> </asp:DropDownList>
>>>
>>>
>>> ///////////////
>>>
>>
>>
>
>