how to solve this error

Posted by Gow.Net under JavaScript on 7/15/2012 | Points: 10 | Views : 1196 | Status : [Member] | Replies : 1
Hi i am used two auto completed textbox on autocompletedtextbox selected item based bind another autocompletedtextbox so i try below code here i get one error Microsoft JScript runtime error: 'null' is null or not an object how to solve this

<script src="../jquery-1.5.min.js"type="text/javascript"></script>
<script type="text/javascript">
function Selectarea(source, eventArgs)
{

$find('Searchautocomplete').set_contextKey(eventArgs.get_value());


}

</script>
<table>
<tr>
<td>
<asp:TextBox ID="txt_city" runat="server"></asp:TextBox>
<asp:TextBoxWatermarkExtender ID="watermark1" runat="server" TargetControlID="txt_city" WatermarkText="Coimbatore"></asp:TextBoxWatermarkExtender>
<asp:AutoCompleteExtender ID="cityautocomplete"
TargetControlID="txt_city"
runat="server"
MinimumPrefixLength="1"
CompletionInterval="10"
EnableCaching="true"
ServiceMethod="GetCompletionList"
OnClientItemSelected="Selectarea"
ServicePath="~/AutoComplete.asmx"></asp:AutoCompleteExtender>
</td>
<td>
<asp:TextBox ID="txt_Search" runat="server" Height="21px" Width="281px"></asp:TextBox>
<asp:AutoCompleteExtender ID="Searchautocomplete"
TargetControlID="txt_Search"
runat="server"
MinimumPrefixLength="1"
CompletionInterval="10"
EnableCaching="true"
ServiceMethod="GetSearchList"
ServicePath="~/AutoComplete.asmx"></asp:AutoCompleteExtender>
<asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txt_Search" WatermarkText="Search Example - ICICI Bank"></asp:TextBoxWatermarkExtender>

</td>
<td>
<asp:TextBox ID="txt_Place" runat="server"> </asp:TextBox>
<asp:AutoCompleteExtender ID="AutoCompleteExtender1"
TargetControlID="txt_Place"
runat="server"
MinimumPrefixLength="1"
CompletionInterval="10"
EnableCaching="true"
ServiceMethod="GetAreaList"
ServicePath="~/AutoComplete.asmx"></asp:AutoCompleteExtender>
<asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server" TargetControlID="txt_Place" WatermarkText="Rspuram"></asp:TextBoxWatermarkExtender>

</td>
<td>
<asp:Button ID="btn_Search" runat="server" Text="Go" onclick="btn_Search_Click" />
</td>
</tr>

</table>


gowthaman8870226416


Responses

Posted by: Hemanthlaxmi on: 7/16/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Gowtham,

function Selectarea(source, eventArgs)
{

debugger;
$find('Searchautocomplete').set_contextKey(eventArgs.get_value());

}

I think here you are getting the Null value .
eventArgs.get_value()

If this helps you .
Please "Mark as Answer"

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response