Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected string GMap1_Click1(object s, GAjaxServerEventArgs e)
    {
       
        if (RadioButtonList1.SelectedIndex==0)
        {
            
            return "radio first checked";
        }
        else if (RadioButtonList1.SelectedIndex == 1)
        {
            
            return "radio second checked";
        }
        else
       {
           return "no Selected";
       }
       
    }



when i using button click event than it will return true value but when i using gmap_click event than it will return only no selected
plz help me
Posted
Updated 10-Oct-13 23:56pm
v3
Comments
Thanks7872 10-Oct-13 5:29am    
How you binded this list in Page_Load event? Make sure its inside if(!IsPostBack)
Tom Marvolo Riddle 10-Oct-13 5:30am    
Selected Value may get clear.check it.
Bama Boy 10-Oct-13 5:31am    
i static bind in design

<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Circle
<asp:ListItem>Polygon
Bama Boy 10-Oct-13 5:32am    
i also used simple radio button but it also not work
Bama Boy 10-Oct-13 5:35am    
i checked select value not working

1 solution

Perform Your action in this way
ASP.NET
<radiobuttonlist id="rblcat"  runat="server">
<asp:listitem text="Circle" value="0" xmlns:asp="#unknown">
<asp:listitem text="Polygon" value="1">


now on .cs file jst do

C#
if(convert.tostring(rblcat.selectedvalue)=="0")
{
return Circle
}
else if(convert.tostring(rblcat.selectedvalue)=="1")
{
return Polygon
}
try and let me know
 
Share this answer
 
v3
Comments
Bama Boy 10-Oct-13 5:59am    
it contain "" value not take "0" and "1"
Bama Boy 10-Oct-13 6:00am    
i execute demo on button click event in that it will run but in gmap_click not run

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900