473,396 Members | 1,608 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,396 software developers and data experts.

Why does webform cannot get data?

Tom
Hi,

I built an aspx page with c#. There are many textbox and a
submit button. When I input data in form and click submit,
I saw their values are null in debug window.

I checked namespace is correct.

What is the potential bug in my program?

Thanks
Nov 18 '05 #1
6 1112
Hi,
I think there is some problems in Postback, can u check
the properties once again.

Regards
Mahesh ChandraMouli
-----Original Message-----
Hi,

I built an aspx page with c#. There are many textbox and asubmit button. When I input data in form and click submit,I saw their values are null in debug window.

I checked namespace is correct.

What is the potential bug in my program?

Thanks
.

Nov 18 '05 #2
Hello Tom,

Tom wrote:
I built an aspx page with c#. There are many textbox and a
submit button. When I input data in form and click submit,
I saw their values are null in debug window.


During which event do you check the values with the debugger ?
If you check the values in Page_Load, the textboxes will not
yet have the new value. They will not have the new value
before the TextBox_Change event. [ At least, if everything's working OK ]
Try checking the values in TextBox_Change or Button_Click.

Best regards,

Eric
Nov 18 '05 #3
Tom
Hi,

I added breakpoint in button and the insert method to pass
those parameters of textbox to sql.

There are 10 parameters, 3 of them can show values, others
are null.

I checked their properties and id, all are ok.

So, where should I check now?

thanks
Nov 18 '05 #4
Hello Tom,

Tom wrote:
I checked their properties and id, all are ok.
So, where should I check now?


Can you perhaps post the code ( aspx and aspx.cs/aspx.vb ) ?
If it is a lot, please remove the irrelevant parts, so the
code is just enough to reproduce the problem.

Best regards,

Eric
Nov 18 '05 #5
Tom
Hi Eric,

I have 2 classes. One is for user to register, get and set
user info. Another one is for user to add product info.

Both of them have static insert method. Insert user info
and product info respectively in 2 different classes.

It is the code of the cs file behind the aspx:

protected Web.User objOperator;

private void Page_Load(object sender, System.EventArgs e)
{
objOperator = (Web.User)Session["UserName"];

if(!IsPostBack)
{
this.Bind_New();
}
}

private void button_Click(object sender, System.EventArgs
e)
{
this.Insert_Data(objOperator);
}

I added breakpoint in button method, I saw that all data
can be passed from webform.

private void Insert_Data(Web.User objOperator)
{
try
{
Web.Product.Insert(
objOperator.UserID,
Int32.Parse(this.AreaID.SelectedItem.Value),
this.Addr.Text,
......
);
}
catch(Exception e)
{
Response.Write(e.Message);
}

I added breakpoint here. All webform data were null. It
said error in getting the values. And, it throws
FormatException. Web.Product.Insert method is a way to
insert web form data to DB through Stored Procedure.

But, I use the same way to do register page, but no error.

Can I pass the value in user object to product?

Anyway to narrow down the finding of the bug? I added
breakpoint in product class, but the program did not stop
to let me see their values.

What's wrong with my code?

Thanks for your advice.

Tom



Nov 18 '05 #6
Hello Tom,

Tom wrote:
Can I pass the value in user object to product?
I don't see any problems with that.
What's wrong with my code?


I don't see anything odd.
Can you perhaps also post the aspx file ?

Best regards,

Eric
Nov 18 '05 #7

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

Similar topics

3
by: Prasad Patil | last post by:
Hi, I have a webform, The link on the webform should call the exe program installed on the client machine when the user click the link on the webform. It should run the exe installed on the...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
11
by: Mark Goldin | last post by:
Very simplified: namespace humanres { public class main2 : System.Web.UI.Page {
1
by: Adjo | last post by:
Okay, I've seen all the examples of using comboboxes on webforms when using simple values. And in the issue-tracker starterkit there is a way to use comboboxes with id/value foreign keys in a smart...
0
by: KentEMon | last post by:
I have a field in my SQL database table which has phone numbers stored with no "-" character. That is, 4540090 rather than 454-0090. I have a webform datagrid and wish to display these values in a...
7
by: Dean Slindee | last post by:
I would like to hear some practical comments about how to decide whether a new application becomes a Winform vs a Webform application. Would you say that every app should be, by default, a Winform...
0
by: Ivan Sammut | last post by:
Is it possible to bind a textbox on a webform to some field in my database cause I can't get it 2 work. I binded a list of country to a dropdownlist, now all I need is that everytime my users...
3
by: Dean Slindee | last post by:
Would like to call the TabShow function on WebForm InOutHost from another WebForm in same project, but cannot figure out how to get a reference. Can this be done? In this statement: Call...
7
by: Max | last post by:
Please somebody can shed a light... How can I have a variable visible and modifiable, inside one and only webform? I mean , I d like to see that variable from all the Sub of that webform code,...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.