Click here to Skip to main content
15,911,789 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to make session secure? Pin
anilpal25-Mar-09 21:28
anilpal25-Mar-09 21:28 
GeneralRe: how to make session secure? Pin
RajpootRohan25-Mar-09 21:35
professionalRajpootRohan25-Mar-09 21:35 
GeneralRe: how to make session secure? Pin
anilpal25-Mar-09 22:35
anilpal25-Mar-09 22:35 
GeneralRe: how to make session secure? Pin
RajpootRohan25-Mar-09 22:56
professionalRajpootRohan25-Mar-09 22:56 
GeneralRe: how to make session secure? Pin
N a v a n e e t h25-Mar-09 23:14
N a v a n e e t h25-Mar-09 23:14 
GeneralRe: how to make session secure? Pin
RajpootRohan25-Mar-09 23:19
professionalRajpootRohan25-Mar-09 23:19 
GeneralRe: how to make session secure? Pin
N a v a n e e t h25-Mar-09 23:31
N a v a n e e t h25-Mar-09 23:31 
GeneralRe: how to make session secure? Pin
RajpootRohan25-Mar-09 23:35
professionalRajpootRohan25-Mar-09 23:35 
GeneralRe: how to make session secure? Pin
RajpootRohan26-Mar-09 2:11
professionalRajpootRohan26-Mar-09 2:11 
GeneralRe: how to make session secure? Pin
anilpal26-Mar-09 2:46
anilpal26-Mar-09 2:46 
GeneralRe: how to make session secure? Pin
RajpootRohan26-Mar-09 3:09
professionalRajpootRohan26-Mar-09 3:09 
GeneralRe: how to make session secure? Pin
anilpal26-Mar-09 3:31
anilpal26-Mar-09 3:31 
GeneralRe: how to make session secure? Pin
anilpal26-Mar-09 3:34
anilpal26-Mar-09 3:34 
GeneralRe: how to make session secure? Pin
RajpootRohan26-Mar-09 19:28
professionalRajpootRohan26-Mar-09 19:28 
GeneralRe: how to make session secure? Pin
RajpootRohan26-Mar-09 19:45
professionalRajpootRohan26-Mar-09 19:45 
QuestionASP Pages are not running in .net 1.1Application Pin
yadlaprasad25-Mar-09 21:05
yadlaprasad25-Mar-09 21:05 
AnswerRe: ASP Pages are not running in .net 1.1Application Pin
anilpal25-Mar-09 21:33
anilpal25-Mar-09 21:33 
GeneralRe: ASP Pages are not running in .net 1.1Application Pin
yadlaprasad25-Mar-09 21:47
yadlaprasad25-Mar-09 21:47 
GeneralRe: ASP Pages are not running in .net 1.1Application Pin
anilpal25-Mar-09 22:37
anilpal25-Mar-09 22:37 
QuestionDrop Down Lists Pin
scar_face25-Mar-09 20:47
scar_face25-Mar-09 20:47 
AnswerRe: Drop Down Lists Pin
anilpal25-Mar-09 22:45
anilpal25-Mar-09 22:45 
GeneralRe: Drop Down Lists Pin
scar_face25-Mar-09 23:01
scar_face25-Mar-09 23:01 
GeneralRe: Drop Down Lists Pin
anilpal25-Mar-09 23:15
anilpal25-Mar-09 23:15 
GeneralRe: Drop Down Lists Pin
scar_face25-Mar-09 23:29
scar_face25-Mar-09 23:29 
Please have a look at my code:

<asp:GridView ID="grd" runat="server" OnRowDataBound="grd_RowDataBound">   
    
  
<Columns>    
  
  
<asp:TemplateField HeaderText="names">   
  
    
  
  
<ItemTemplate>  
  
    
  
  
<asp:DropDownList ID="name" runat="server" OnSelectedIndexChanged="onSelectChangeddl"></asp:DropDownList>  
  
    
  
</ItemTemplate>  
  
    
  
</asp:TemplateField>  
  
    
  
<asp:TemplateField HeaderText="age">   
  
    
  
<ItemTemplate>  
  
    
  
<asp:DropDownList ID="age" runat="server" AutoPostBack="true">   
  
    
  
</asp:DropDownList>  
  
    
  
  
</ItemTemplate>  
  
    
  
</asp:TemplateField>  
  
</Columns>  
  
    
  
</asp:GridView>  



In c# code, i am trying to change the values of the second drop down list based on the value selected in the first. I am doing this as below:


foreach (GridViewRow row in grd.Rows)   
{   
DropDownList ddl1 = (DropDownList)row.FindControl("name");   
DropDownList ddl = (DropDownList)row.FindControl("age");   
  
  
if (ddl.SelectedValue.ToString() != "---Select---")   
  
{   
  
}   
  
else   
    
  
{   
  
ddl.Items.Clear();   
  
}   
  
    
  
SqlCommand SPComm = new SqlCommand("someStoredProcedure", myConn);   
  
SPComm.CommandType = CommandType.StoredProcedure;   
  
SqlParameter param = SPComm.Parameters.Add("@something", SqlDbType.NVarChar, 50);   
  
param.Value = something;   
  
dr = SPComm.ExecuteReader();  //dr is sqlDataReader   
  
int i = 0;   
  
while (dr.Read())   
  
{   
  
ddl.Items.Insert(i, dr.GetString(0));   
  
}   
  
dr.Close();   
  
ddl.Items.Insert(0, "---Select---");   
  
}  



In the above code, all the values in the second drop down list are getting duplicated based on the selected index changed event handler of the first drop down list.

scarface

GeneralRe: Drop Down Lists Pin
anilpal26-Mar-09 2:54
anilpal26-Mar-09 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.