<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Discussion and Suggestions</title><link>http://forums.asp.net/1007.aspx</link><description>This forum is the place for ASP.NET AJAX 'getting started' questions, general questions that don't fit in one of the other forums about AJAX </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: problem with dropdownlist and textbox in ajax</title><link>http://forums.asp.net/thread/3276106.aspx</link><pubDate>Mon, 06 Jul 2009 06:27:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3276106</guid><dc:creator>girish dagdiya</dc:creator><author>girish dagdiya</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3276106.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=3276106</wfw:commentRss><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;the problem get solved.The problem was with registering client script.&lt;/p&gt;
&lt;p&gt;ScriptManager.RegisterClientScriptBlock(Page,this.GetType(),&amp;quot;script&amp;quot;,&amp;quot;javascript:fun()&amp;quot;,true);&lt;/p&gt;
&lt;p&gt;this is correct and working.&lt;/p&gt;
&lt;p&gt;Thank you to all.&lt;/p&gt;</description></item><item><title>Re: problem with dropdownlist and textbox in ajax</title><link>http://forums.asp.net/thread/3275307.aspx</link><pubDate>Sun, 05 Jul 2009 11:29:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275307</guid><dc:creator>girish dagdiya</dc:creator><author>girish dagdiya</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275307.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=3275307</wfw:commentRss><description>&lt;p&gt; hi,&lt;/p&gt;&lt;p&gt;thanks Pawan Mishra for quick reply.But it&amp;#39;s not solved yet.Because i want to keep textbox visible=false and after clicking ONLY on &amp;quot;Other&amp;quot;,i want to show that textbox.Without scriptmanager and updatepanel i can do that but when i use updatepanel Textbox is not showing.&lt;/p&gt;&lt;p&gt;Thanks in advance.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;</description></item><item><title>Re: problem with dropdownlist and textbox in ajax</title><link>http://forums.asp.net/thread/3274955.aspx</link><pubDate>Sat, 04 Jul 2009 20:56:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274955</guid><dc:creator>RatheeshC</dc:creator><author>RatheeshC</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274955.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=3274955</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Add Onchange event to ypur dropdown like this&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:DropDownList ID=&amp;quot;DropDownList1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;onselectedindexchanged=&amp;quot;DropDownList1_SelectedIndexChanged&amp;quot; onchange= moveRight();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;AutoPostBack=&amp;quot;True&amp;quot; Width=&amp;quot;185px&amp;quot; Height=&amp;quot;18px&amp;quot; AppendDataBoundItems=&amp;quot;True&amp;quot; &amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: problem with dropdownlist and textbox in ajax</title><link>http://forums.asp.net/thread/3274901.aspx</link><pubDate>Sat, 04 Jul 2009 18:43:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274901</guid><dc:creator>Pawan_Mishra</dc:creator><author>Pawan_Mishra</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274901.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=3274901</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;&lt;p&gt;You can do this by directly attaching an event handler for the change event of dropdown list control and in that handler you can do the custom client side logic . All these can be done in client side itself :-&lt;/p&gt;&lt;p&gt;function pageLoad()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$addHandler($get(&amp;#39;&amp;lt;% = &amp;lt;id of the dropdown list control&amp;gt;.ClientId %&amp;gt;&amp;#39;),&amp;#39;change&amp;#39;,onChange);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function onChange(evt)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//here you can put the custom javascript functionality &lt;br /&gt;}&lt;/p&gt;</description></item><item><title>problem with dropdownlist and textbox in ajax</title><link>http://forums.asp.net/thread/3274783.aspx</link><pubDate>Sat, 04 Jul 2009 15:42:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274783</guid><dc:creator>girish dagdiya</dc:creator><author>girish dagdiya</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274783.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=3274783</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;hi,&lt;/p&gt;
&lt;p&gt;i want to call a javascript&amp;nbsp;function on selected index changed of dropdownlist in ajax page.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt; &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    
                function moveRight(){
                 document.getElementById(&amp;#39;TextBox1&amp;#39;).style.position= &amp;#39;absolute&amp;#39;;
                   document.getElementById(&amp;#39;DropDownList1&amp;#39;).style.position= &amp;#39;absolute&amp;#39;;
              var obj=document.getElementById(&amp;#39;TextBox1&amp;#39;);
              var x=document.getElementById(&amp;#39;DropDownList1&amp;#39;).offsetLeft;
              var y=document.getElementById(&amp;#39;DropDownList1&amp;#39;).offsetTop;
            alert(x);
              obj.style.left=x;
               obj.style.top=y + &amp;#39;px&amp;#39;;
   
}



    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
   &amp;lt;asp:ScriptManager ID=&amp;quot;ab&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:ScriptManager&amp;gt;
   &amp;lt;asp:UpdatePanel ID=&amp;quot;up&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
        &amp;lt;ContentTemplate&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;asp:DropDownList ID=&amp;quot;DropDownList1&amp;quot; runat=&amp;quot;server&amp;quot; 
            onselectedindexchanged=&amp;quot;DropDownList1_SelectedIndexChanged&amp;quot; 
            AutoPostBack=&amp;quot;True&amp;quot; Width=&amp;quot;185px&amp;quot; Height=&amp;quot;18px&amp;quot; AppendDataBoundItems=&amp;quot;True&amp;quot; &amp;gt;
            &amp;lt;asp:ListItem&amp;gt;Nokia&amp;lt;/asp:ListItem&amp;gt;
            &amp;lt;asp:ListItem&amp;gt;LG&amp;lt;/asp:ListItem&amp;gt;
            &amp;lt;asp:ListItem&amp;gt;Samsung&amp;lt;/asp:ListItem&amp;gt;
            &amp;lt;asp:ListItem&amp;gt;Motorola&amp;lt;/asp:ListItem&amp;gt;
        &amp;lt;/asp:DropDownList&amp;gt;
    
    &amp;lt;/div&amp;gt;&amp;lt;/ContentTemplate&amp;gt;&amp;lt;/asp:UpdatePanel&amp;gt;
    &amp;lt;p&amp;gt;

    &amp;lt;asp:TextBox ID=&amp;quot;TextBox1&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;164px&amp;quot; Height=&amp;quot;16px&amp;quot;
        Visible=&amp;quot;false&amp;quot; style=&amp;quot;top: 98px; left: 130px; position: absolute;&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
    &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;

    &amp;nbsp;&amp;lt;/p&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;



 protected void Page_Load(object sender, EventArgs e)
    {
       
        DropDownList1.Items.Add(&amp;quot;Other&amp;quot;);

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        if (DropDownList1.SelectedItem.Value  == &amp;quot;Other&amp;quot;)
        {
            TextBox1.Visible = true;
            string scr = &amp;quot;&amp;lt;script type=&amp;#39;text/javascript&amp;#39;&amp;gt;&amp;quot;;
            scr += &amp;quot;alert(&amp;#39;hi&amp;#39;);&amp;quot;;
            scr += &amp;quot;moveRight();&amp;quot;;
            ScriptManager.RegisterClientScriptBlock(DropDownList1, typeof(DropDownList), &amp;quot;moveRight&amp;quot;, scr, true);
                  


        }
        else
            TextBox1.Visible = false;

    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>