Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 641
  • Last Modified:

UpdatePanel not working?

I have a control on an update panel.

The control has a bunch of child controls that are added dynamically at runtime.

The child controls each have a radio button, that, when clicked, causes a postback by calling the javascript method __doPostback(  )  that ASP .NET provides.

When I click the radio button in a control the page does a full postback.


Why is the UpdatePanel not working?

Does __doPostback(  )   defeat what the UpdatePanel does?
<asp:UpdatePanel ID="UpdatePanelCaptchaRepeater" runat="server">
					<ContentTemplate>
						<uc2:CaptchaRepeater ID="CaptchaRepeater" runat="server" />
					</ContentTemplate>
				</asp:UpdatePanel>

Open in new window

0
Tom Knowlton
Asked:
Tom Knowlton
  • 3
  • 3
1 Solution
 
Gyanendra SinghArchitectCommented:
I am sure you were not setting of id of any child control .... Please set the ID and test ...
0
 
Gyanendra SinghArchitectCommented:
putting one example for your help

 LinkButton lnkAnyName = new LinkButton();

lnkAnyName .Text = Any Title;


lnkAnyName .ID= Any Unique Id; //This you need to set


lnkAnyName .Click += new EventHandler(lnkAnyName_Click);

PlaceHolderName.Controls.Add(lnkAnyName );
0
 
Tom KnowltonWeb developerAuthor Commented:
Still checking on this.


More info....here is the markup for the rendered page:
<table width="100">
    <tr>
        <td align="center" class="style1">
	        <img id="ctl00_ctl00_bodyContent_mainContent_CaptchaRepeater_CaptchaImageDisplay_ImageCaptcha" title="http://www.freeurldirectory.com/captcha.php" src="http://www.freeurldirectory.com/captcha.php" style="border-width:2px;border-style:Solid;height:100px;width:100px;" />
        </td>         
        <td>
					&nbsp;</td>
    </tr>
    <tr>
        <td align="center" class="style1">
            <input id="ctl00_ctl00_bodyContent_mainContent_CaptchaRepeater_CaptchaImageDisplay_ValueRadioButtonCaptchaSelected" type="radio" name="ctl00$ctl00$bodyContent$mainContent$CaptchaRepeater$CaptchaImageDisplay$ValueRadioButtonCaptchaSelected" value="4" onclick="RadioChecked(this);" />
        </td>
    		<td></td>
    </tr>
</table>

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Tom KnowltonWeb developerAuthor Commented:
RadioChecked( this  )  looks like this:
        function RadioChecked(current)
        {               
           for(i = 0; i < document.forms[0].elements.length; i++)
           {
              elm = document.forms[0].elements[i];
                          
              if (elm.type == 'radio')      
              {           
                    if(elm != current)
                    {
                        elm.checked = false;                                                              
                    }
              }
           }   
						__doPostBack(current.value,'CAPTCHARADIO');              
        }

Open in new window

0
 
Gyanendra SinghArchitectCommented:
please paste your code where you are creating radio button
0
 
Tom KnowltonWeb developerAuthor Commented:
UPDATE:

The issue got resolved by taking another approach.

But I think you were on the right track.

Tom
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now