Click here to Skip to main content
15,886,199 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRePost : Already asked in other forum. Pin
nagendrathecoder27-Apr-10 19:57
nagendrathecoder27-Apr-10 19:57 
AnswerRe: change an image to the color.. Pin
Shivan Nandan28-Apr-10 0:11
Shivan Nandan28-Apr-10 0:11 
AnswerRe: change an image to the color.. Pin
Sandesh M Patil28-Apr-10 0:11
Sandesh M Patil28-Apr-10 0:11 
Questionhow to Concatenate values from gridview to textbox in asp.net Pin
diyaa_0827-Apr-10 19:34
diyaa_0827-Apr-10 19:34 
AnswerRe: how to Concatenate values from gridview to textbox in asp.net [modified] Pin
nagendrathecoder27-Apr-10 19:46
nagendrathecoder27-Apr-10 19:46 
GeneralRe: how to Concatenate values from gridview to textbox in asp.net Pin
diyaa_0827-Apr-10 20:52
diyaa_0827-Apr-10 20:52 
GeneralRe: how to Concatenate values from gridview to textbox in asp.net Pin
nagendrathecoder27-Apr-10 21:22
nagendrathecoder27-Apr-10 21:22 
QuestionProblem with Dropdownlist (DDL) box... Pin
<<Tash18>>27-Apr-10 19:29
<<Tash18>>27-Apr-10 19:29 
Hi guys.. Im working on a web application on C#.net with VS2003(Framework1.1).. in my page i have a DDL which populates the items from the database... now on my page the user fills a form by selecting the items from the DDL. The user can also edit previous froms, at this stage the datas come from the database and gets filled on the textbox,DDL, radio buttons etc to edit the fields. Now when a data from the database is not present in the DDL list i get an exception to handle this situation i need to set a condition such that it checks if the data from the database is present in the DDL list then it shows in the DDL otherwise it must show the Fist item in the DDL which is "Select an option". so i put up the following condition:

if(ddl_Benef.Items.FindByValue(myDr["BenefName"].ToString().Trim()).Value == myDr["BenefName"].ToString())
					{
						ddl_Benef.Items.FindByValue(myDr["BenefName"].ToString().Trim()).Selected=true;
					}
					else
					{
						ddl_Benef.Items.FindByText("Select an option").Selected=true;
					}


here if the data from the database is present in the DDL the code works fine in case the data is not present in the DDL then it doesnt go to the else condition instead gives me "System.NullReferenceException: Object reference not set to an instance of an object."
Any help or advice is appreciated...

Thanx in advance,
Tash
AnswerRe: Problem with Dropdownlist (DDL) box... Pin
Ankur\m/27-Apr-10 20:04
professionalAnkur\m/27-Apr-10 20:04 
GeneralRe: Problem with Dropdownlist (DDL) box... Pin
<<Tash18>>27-Apr-10 21:22
<<Tash18>>27-Apr-10 21:22 
AnswerRe: Problem with Dropdownlist (DDL) box... Pin
nagendrathecoder27-Apr-10 21:27
nagendrathecoder27-Apr-10 21:27 
GeneralRe: Problem with Dropdownlist (DDL) box... Pin
<<Tash18>>27-Apr-10 21:43
<<Tash18>>27-Apr-10 21:43 
AnswerRe: Problem with Dropdownlist (DDL) box... Pin
Ankur\m/27-Apr-10 21:29
professionalAnkur\m/27-Apr-10 21:29 
GeneralRe: Problem with Dropdownlist (DDL) box... Pin
<<Tash18>>27-Apr-10 21:42
<<Tash18>>27-Apr-10 21:42 
AnswerRe: Problem with Dropdownlist (DDL) box... Pin
nagendrathecoder27-Apr-10 22:06
nagendrathecoder27-Apr-10 22:06 
AnswerRe: Problem with Dropdownlist (DDL) box... Pin
Mohammed Hameed28-Apr-10 2:58
professionalMohammed Hameed28-Apr-10 2:58 
QuestionASP.Net: Losing Javascript events on async postback Pin
Jake Slack27-Apr-10 10:53
Jake Slack27-Apr-10 10:53 
AnswerRe: ASP.Net: Losing Javascript events on async postback Pin
daveyerwin27-Apr-10 14:12
daveyerwin27-Apr-10 14:12 
GeneralRe: ASP.Net: Losing Javascript events on async postback Pin
Jake Slack28-Apr-10 2:09
Jake Slack28-Apr-10 2:09 
GeneralRe: ASP.Net: Losing Javascript events on async postback Pin
daveyerwin28-Apr-10 2:31
daveyerwin28-Apr-10 2:31 
QuestionItemTemplate can't find a control in placeholder Pin
mark_me27-Apr-10 9:44
mark_me27-Apr-10 9:44 
AnswerRe: ItemTemplate can't find a control in placeholder Pin
Jamil Hallal27-Apr-10 21:03
professionalJamil Hallal27-Apr-10 21:03 
GeneralRe: ItemTemplate can't find a control in placeholder Pin
mark_me28-Apr-10 11:40
mark_me28-Apr-10 11:40 
QuestionFree Online Test and Interview Questions Pin
Nikhil Bandekar27-Apr-10 7:11
Nikhil Bandekar27-Apr-10 7:11 
AnswerRe: Free Online Test and Interview Questions Pin
Sandeep Mewara27-Apr-10 18:56
mveSandeep Mewara27-Apr-10 18:56 

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.