CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    15

    Messsage doesn't show

    I need to show a message whenever user Select option"A"
    heres the code for aspx
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="~/Search.aspx.cs" Inherits="HITS.Search" MasterPageFile="~/hits_main.master"%>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <asp:ScriptManager ID="scMgr" runat="server"/>
    <div>
    <%--<asp:UpdatePanel ID="UP1" runat="server" >
      <ContentTemplate> 
      </ContentTemplate>
     
    </asp:UpdatePanel> --%>
        <table  cellspacing="10" border=".02">   
        <tr>   
          <td   align="left"  > 
              <asp:RadioButtonList ID="RBl1" runat="server" AutoPostBack="True"                               
                                    CellPadding="2" CellSpacing="5" 
                  onselectedindexchanged="RBl1_SelectedIndexChanged">
                <asp:ListItem  Value="G" Selected="True" >Regular Grants</asp:ListItem>
                <asp:ListItem Value ="A">ARRA Grants</asp:ListItem>
                <asp:ListItem Value ="C">Contract</asp:ListItem>
                </asp:RadioButtonList>                 
             
             </td>
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: Messsage doesn't show

    If you mean by showing a message that you want to alert an message (javascript alert function), you can do this as next (inside your selectedIndexChanged eventhandler)

    Code:
    // if the dropdownlist is on a normal page
    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "message_script", "alert('You selected option A');", true);
    
    //if the page is on an UpdatePanel
    ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "message_script", "alert('You selected option A');", true);

  3. #3
    Join Date
    Jun 2009
    Posts
    15

    Re: Messsage doesn't show

    Thanks it work really nicely
    I am happy.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured