473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Urgent: Please need help badly

hi all

I am facing a little problem. I have a form with a dropdownlist control. I have a button and when i click the form posts back
The problem is that in the on button click event i'm calling this metho
------------------
Sub cute(sender As Object, e As EventArgs
Response.Write(ddlColors.SelectedItem.text
End Su

------------------
in which i'm only trying to access my dropdownlist ddlColors's selected value. It gives me this exception
---------------------------------------------------------------------------------------------
System.NullReferenceException: Object reference not set to an instance of an objec
---------------------------------------------------------------------------------------------

Please tell me what can i do about this and what am i doing wrong

thanks!
Nov 18 '05 #1
3 1232
Hi, Bilal,

Try to debug your code to see what is in fact null-reference (Nothing in
VB.NET).

Greetings
Martin
"Bilal" <bs*****@apparelco.com> wrote in message
news:09**********************************@microsof t.com...
hi all,

I am facing a little problem. I have a form with a dropdownlist control. I have a button and when i click the form posts back. The problem is that in the on button click event i'm calling this method
-------------------
Sub cute(sender As Object, e As EventArgs)
Response.Write(ddlColors.SelectedItem.text)
End Sub

-------------------
in which i'm only trying to access my dropdownlist ddlColors's selected value. It gives me this exception: -------------------------------------------------------------------------- -------------------- System.NullReferenceException: Object reference not set to an instance of an object -------------------------------------------------------------------------- --------------------
Please tell me what can i do about this and what am i doing wrong.

thanks!

Nov 18 '05 #2
Kindly send the code:
so that it can be debugged.
As if there is any value in the dropdownlist and if u are calling the
function at the click of the button then it should work.
Arvind.
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:e2*************@TK2MSFTNGP11.phx.gbl...
Hi, Bilal,

Try to debug your code to see what is in fact null-reference (Nothing in
VB.NET).

Greetings
Martin
"Bilal" <bs*****@apparelco.com> wrote in message
news:09**********************************@microsof t.com...
hi all,

I am facing a little problem. I have a form with a dropdownlist control.
I have a button and when i click the form posts back.
The problem is that in the on button click event i'm calling this method
-------------------
Sub cute(sender As Object, e As EventArgs)
Response.Write(ddlColors.SelectedItem.text)
End Sub

-------------------
in which i'm only trying to access my dropdownlist ddlColors's selected value. It gives me this exception:

--------------------------------------------------------------------------
--------------------
System.NullReferenceException: Object reference not set to an instance

of an object

--------------------------------------------------------------------------
--------------------

Please tell me what can i do about this and what am i doing wrong.

thanks!


Nov 18 '05 #3
hey Arvind
thanks for your reply. i figured that out by moving my code where i populated the dropdownlist into the sub page_load and there it works fine. I am really a new bie at .net and am trying to move to vs.net from visual interdev

I have one another problem which i encounter when i create a new file in vs.net. I am pasting the error. Basically I have a file named ShoppingCart.aspx which when i build and browse gives the error below
Please help me
---------------------------------------------------
Server Error in '/OnLineShopping' Application
-------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'OnLineShopping.ShoppingCart'

Source Error:

Line 1: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="ShoppingCart.aspx.vb" Inherits="OnLineShopping.ShoppingCart"%
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
Line 3: <html
Source File: C:\Inetpub\wwwroot\OnLineShopping\ShoppingCart.asp x Line: 1

-------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
---------------------------------------------------
----- Arvind P Rangan wrote: ----

Kindly send the code
so that it can be debugged
As if there is any value in the dropdownlist and if u are calling th
function at the click of the button then it should work
Arvind
"Martin Dechev" <de*******@hotmail.com> wrote in messag
news:e2*************@TK2MSFTNGP11.phx.gbl..
Hi, Bilal
Try to debug your code to see what is in fact null-reference (Nothing i VB.NET)
Greeting

Marti
"Bilal" <bs*****@apparelco.com> wrote in messag
news:09**********************************@microsof t.com..
hi all
I am facing a little problem. I have a form with a dropdownlist control
have a button and when i click the form posts back
The problem is that in the on button click event i'm calling this metho
------------------
Sub cute(sender As Object, e As EventArgs
Response.Write(ddlColors.SelectedItem.text
End Su
------------------ in which i'm only trying to access my dropdownlist ddlColors's selecte

value. It gives me this exception
-------------------------------------------------------------------------

-------------------
System.NullReferenceException: Object reference not set to an instanc

o an objec
-------------------------------------------------------------------------

------------------- Please tell me what can i do about this and what am i doing wrong
thanks

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christopher Benson-Manica | last post by:
Is there anything that one can do to a std::ostringstream that would make its destructor explode? I'm basically doing { std::ostringstream ss, msg; // do BUNCHES of stuff with ss and msg ...
0
by: Amjath | last post by:
I put all my application updater block dll to GAC, to avoid keeping this dll's in my bin folder. After doing this all i build my project, it works fine, now i run my project it give me an error...
13
by: Gohar | last post by:
Any one please send me the C++ code for arithmatic calculator using linked lists Which performs addition ,subtraction,multiplication,division and modulus(using operator overloading). i need it...
7
by: Gohar | last post by:
Any one can send me the C++ code for arithmatic calculator using linked list(with operator overloading. not necessarily). which performs Addition, subtraction ,multiplication,division,modulus. i...
2
by: cryon.b | last post by:
Hi To All, I took up the IBM sample testfor Exam 700 today and I have the test tomorrow,I have some questions for which Iam not sure about the right answer,can anyone please guide me as to what is...
0
by: dinoo | last post by:
I did not find the right forum to post this issue, please excuse me for this. But I need the help here very badly. I am having a Windows Service in .NET which is accessing a MDB file which is...
3
by: araunity2005 | last post by:
I badly need help in makinga program to the following solution and I have no idea how to do it.Can someone please help me. The link is to the content which was given for practise before exams, It is...
77
by: Hans Schneider | last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); }
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.