Click here to Skip to main content
15,919,358 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: six objects in ASP.Net Pin
J4amieC12-May-08 1:48
J4amieC12-May-08 1:48 
Questionhow to call back from server side Pin
Piyush Vardhan Singh11-May-08 23:42
Piyush Vardhan Singh11-May-08 23:42 
AnswerRe: how to call back from server side Pin
Christian Graus11-May-08 23:45
protectorChristian Graus11-May-08 23:45 
GeneralRe: how to call back from server side Pin
Piyush Vardhan Singh12-May-08 0:04
Piyush Vardhan Singh12-May-08 0:04 
GeneralRe: how to call back from server side Pin
Christian Graus12-May-08 0:06
protectorChristian Graus12-May-08 0:06 
QuestionProblem with iframe control Pin
Vsree11-May-08 23:29
Vsree11-May-08 23:29 
QuestionObject reference not set to an instance of an object Pin
Saba0211-May-08 23:24
Saba0211-May-08 23:24 
AnswerRe: Object reference not set to an instance of an object Pin
Christian Graus11-May-08 23:27
protectorChristian Graus11-May-08 23:27 
Saba02 wrote:
string Price = double.Parse(((Label)DataList1.Controls[0].FindControl("PriceLabel")).Text).ToString("0.00");


Wow - what horrible code.

Try this:

if (DataList1.Controls.Length > 0)
{
Control c = DataList1.Controls[0];
Label l = c.FindControl("PriceLabel") as Label;
if (l != null)
{
string Price = l.Text;


Apart from the layers of code with no error checking, what on earth possesses you to do a double.Parse, then turn it back to a string ? If you want to make sure the value is a double, use double.TryParse, not a method that, if it fails, throws an exception.

Christian Graus

Please read this if you don't understand the answer I've given you

"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

AnswerRe: Object reference not set to an instance of an object Pin
eyeseetee11-May-08 23:28
eyeseetee11-May-08 23:28 
QuestionRemove additional rows from data table. Pin
rahul.net1111-May-08 22:48
rahul.net1111-May-08 22:48 
AnswerRe: Remove additional rows from data table. Pin
Christian Graus11-May-08 23:13
protectorChristian Graus11-May-08 23:13 
GeneralRe: Remove additional rows from data table. Pin
rahul.net1111-May-08 23:32
rahul.net1111-May-08 23:32 
GeneralRe: Remove additional rows from data table. Pin
Christian Graus11-May-08 23:45
protectorChristian Graus11-May-08 23:45 
GeneralRe: Remove additional rows from data table. Pin
rahul.net1112-May-08 0:02
rahul.net1112-May-08 0:02 
AnswerRe: Remove additional rows from data table. Pin
Eytukan11-May-08 23:19
Eytukan11-May-08 23:19 
QuestionRe: Remove additional rows from data table. Pin
rahul.net1111-May-08 23:29
rahul.net1111-May-08 23:29 
AnswerRe: Remove additional rows from data table. Pin
Christian Graus11-May-08 23:58
protectorChristian Graus11-May-08 23:58 
GeneralRe: Remove additional rows from data table. Pin
rahul.net1112-May-08 0:06
rahul.net1112-May-08 0:06 
GeneralRe: Remove additional rows from data table. Pin
Christian Graus12-May-08 0:07
protectorChristian Graus12-May-08 0:07 
GeneralRe: Remove additional rows from data table. Pin
rahul.net1112-May-08 0:21
rahul.net1112-May-08 0:21 
GeneralRe: Remove additional rows from data table. Pin
Christian Graus12-May-08 11:58
protectorChristian Graus12-May-08 11:58 
Questionusing google search Pin
eyeseetee11-May-08 22:00
eyeseetee11-May-08 22:00 
AnswerRe: using google search Pin
Christian Graus11-May-08 22:10
protectorChristian Graus11-May-08 22:10 
GeneralRe: using google search Pin
Jeremy Falcon11-May-08 22:24
professionalJeremy Falcon11-May-08 22:24 
GeneralRe: using google search Pin
Christian Graus11-May-08 22:37
protectorChristian Graus11-May-08 22:37 

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.