Solved

How to call a command button click event from a radio button.

Posted on 2012-04-06
4
479 Views
Last Modified: 2012-04-06
When the user clicks a radio button, I would like to activate a command button.

 
      <asp:Button ID="cmdGetResults" runat="server"  
                Text="Search" Width="69px" AutoPostBack="True"
                onclick="cmdGetResults_Click" ToolTip="Find high performers"/>
          &nbsp;&nbsp;&nbsp;

 protected void cmdGetResults_Click(object sender, EventArgs e)
    {
         strUserName = User.Identity.Name;
         MembershipUser currentUser = Membership.GetUser(strUserName);
         if (User.Identity.IsAuthenticated)
           {
               strUserName = User.Identity.Name;
               strUserID = currentUser.ProviderUserKey.ToString();
           }

<asp:RadioButton ID="optFindFewer" runat="server" Text="Find Fewer"
        TextAlign="Left" Checked="False"
        oncheckedchanged="optFindFewer_CheckedChanged" GroupName="AdjustSearch"
        AutoPostBack="True" Font-Names="Arial" Font-Size="Small" />
    &nbsp;

protected void optFindFewer_CheckedChanged(object sender, EventArgs e)
    {
       Int16 intTest = 0;
       // Process the cmdGetResults onClick event
        // What do I need to change ?
        cmdGetResults.Click(object sender, EventArgs e);
        intTest = 1;
     }

Thank you,
0
Comment
Question by:Dovberman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:sevensnake77
ID: 37816052
private void optFindFewer_CheckedChanged(Object sender,
                                         EventArgs e)
{
   // Change the check box position to be opposite its current position.
   if (optFindFewer.CheckAlign == ContentAlignment.MiddleLeft)
   {
      optFindFewer.CheckAlign = ContentAlignment.MiddleRight;
   }
   else
   {
      optFindFewer.CheckAlign = ContentAlignment.MiddleLeft;
   }
}
0
 
LVL 14

Accepted Solution

by:
dejaanbu earned 500 total points
ID: 37816167
by calling,

cmdGetResults_Click(sender, e);
0
 

Author Closing Comment

by:Dovberman
ID: 37816315
Just what I needed. Thank you.
0
 
LVL 14

Expert Comment

by:dejaanbu
ID: 37818420
you're Welcome!
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question