.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

หา Control ใน DetailView ยังไงครับ Options · View
nottp
Posted: Thursday, January 10, 2008 11:27:00 PM

Rank: มือพระกาฬ
Groups: Member

Joined: 12/2/2007
Posts: 49
Location: Thai

หาเท่าไรก็ไม่เจอ - - ทำยังไงดีครับ ทำไมตัวอื่นไม่เป็น
 

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 137:    protected void dtvProData_DataBound(object sender, EventArgs e)
Line 138:    {
Line 139:        if (((Image)dtvProData.FindControl("imgPoint")).ImageUrl.ToString() == "~/Images/")
Line 140:            ((Image)dtvProData.FindControl("imgPoint")).Visible = false;
Line 141:        if (((Label)dtvProData.FindControl("lblCost")).Text == "")



I Love .NET
pittawati
Posted: Friday, January 11, 2008 3:59:32 PM

Rank: มือสมัครเล่น
Groups: Member

Joined: 12/2/2007
Posts: 22

อันนี้ยังไม่ได้ลองนะครับ จากที่เคยใช้มาการ Findcontrol น่าจะมี syntax แบบนี้นะครับ

เช่นเราจะ find control textbox ก็ต้องเก็บค่าลง object textbox ก่อน เช่น

  TextBox tb=(TextBox)[ชื่อUser control นั้นๆ].FindControl("[ชื่อcontrol ที่อยุ่ในUser control นั้นๆที่จะ find]");

ปามานนี้นะครับ แล้วถ้ามีเวลาจะลองแล้วเอามาบอกนะครับ ว่า ดีเทลวิว ฟายยังไง  - -"

nottp
Posted: Friday, January 11, 2008 4:34:14 PM

Rank: มือพระกาฬ
Groups: Member

Joined: 12/2/2007
Posts: 49
Location: Thai

ขอบคุณคับ แต่ว่าตัวอื่นผมก็เขียนแบบที่ error ไหง มันไม่ error มา error ตัวนี้ งงจังเลยครับ 



I Love .NET
nottp
Posted: Sunday, January 13, 2008 12:19:39 AM

Rank: มือพระกาฬ
Groups: Member

Joined: 12/2/2007
Posts: 49
Location: Thai

ผมรู้และ มันเป็นที่ฐานข้อมูลครับ เหอๆ แก้ตั้งนาน - -



I Love .NET
pittawati
Posted: Monday, January 14, 2008 10:06:44 AM

Rank: มือสมัครเล่น
Groups: Member

Joined: 12/2/2007
Posts: 22

อะนะ แก้ได้ก็ดีใจด้วยครับ จะได้ไปต่อได้ อิอิ

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by