what is this how to avoid "ctl00" (auto generation ID)

Posted by Gow.Net under JavaScript on 9/11/2012 | Points: 10 | Views : 1481 | Status : [Member] | Replies : 1
following scrip i am using in asp.ne web application
this code will be write in my master page
 <script type="text/javascript">

function IAmSelected(source, eventArgs) {

$find('"AutoCompleteExtender3 ').set_contextKey(eventArgs.get_value());
$find('"AutoCompleteExtender2 ').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>



when i run my application in IE and view page source means following changes will be occurred

 <script type="text/javascript">

function IAmSelected(source, eventArgs) {

$find('"ctl00_AutoCompleteExtender3 ').set_contextKey(eventArgs.get_value());
$find('"ctl00_AutoCompleteExtender2 ').set_contextKey(eventArgs.get_value());

}

</script>


i am using .net frame work 3.5 anyone please tell me i can't attach my coding here because my file size(1.7mb) please give me a your mail id i send it mail else please download my coding this link http://www.mediafire.com/?18wxh8gwaqfvd22 please

gowthaman8870226416


Responses

Posted by: Gow.Net on: 9/12/2012 [Member] Starter | Points: 25

Up
0
Down
i got Answer

<script type="text/javascript">

var txtcity= '<%= txt_city.ClientID %>';
var txtkeys = '<%= txt_key.ClientID %>';
var txtarea = '<%= txt_area.ClientID %>';
var auto2='<%= AutoCompleteExtender2.ClientID %>';
var auto3='<%= AutoCompleteExtender3.ClientID %>';
var controls = {
"txt_city": txtcity,
"txt_key": txtkeys,
"txt_area": txtarea,
"AutoCompleteExtender2":auto2,
"AutoCompleteExtender3":auto3

};

function IAmSelected(source, eventArgs) {
$find(auto2).set_contextKey(eventArgs.get_value());
$find(auto3).set_contextKey(eventArgs.get_value());
}




</script>

 Download source file

gowthaman8870226416

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

Login to post response