Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > ส่งค่าจาก ListView ไปโชว์อีก From นึงโดยกดปุ๋ม LinkButton C# พอดีช่วยแนะนำหน่อยว่าต้องส่งยังไงหรอครับ



 

ส่งค่าจาก ListView ไปโชว์อีก From นึงโดยกดปุ๋ม LinkButton C# พอดีช่วยแนะนำหน่อยว่าต้องส่งยังไงหรอครับ

 



Topic : 119191



โพสกระทู้ ( 9 )
บทความ ( 0 )



สถานะออฟไลน์




From1 หน้า SportsEquipment.aspx

a

From2 หน้า Detailproduct.aspx

a1

โค้ดหน้าListView หน้า SportsEquipment.aspx

Code (C#)
 <asp:ListView ID="ListView1" runat="server" style="text-align: center; color: #CC3300;"  OnItemCommand="ListView1_ItemCommand">
                                
                                <ItemTemplate>
                                    <div class="list">
                                    <table style="border: 1px solid #A55129; 
                                        background-color: #FFF7E7" align="center" >
                     <tr>
                    <td style="width: 100px" Height="200px">
                      
                        <asp:Image ID="image" 
                        ImageUrl='<%# "data:Image/png;base64," + Convert.ToBase64String((byte[])Eval("Productpic")) %>' Height="150px" width="100px"
                        runat="server" />
                    </td>
                    <td style="width: 180px" Height="200px">
                        <table>
                          
                          
                            
                           <tr>
                                <td>
                                    <b>เลขบัตรประชาชน:</b>
                                </td>
                                <td>
                                    <asp:Label ID="lblidcard" 
                                    runat="server" 
                                    Text='<%#Eval("UserIdentification") %>'>
                                    </asp:Label>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <b>ชื่อสินค้า:</b>
                                </td>
                                <td>
                                    <asp:Label ID="lblnameproduct" 
                                    runat="server" 
                                    Text='<%#Eval("Productname") %>'>
                                    </asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>ราคา:</b>
                                </td>
                                <td>
                                    <asp:Label ID="Label2" 
                                    runat="server" 
                                    Text='<%#Eval("Productprice") %>'>
                                    </asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>วันที่ประกาศ:</b>
                                </td>
                                <td>
                                    <asp:Label ID="Label3" 
                                    runat="server" 
                                    Text='<%#Eval("Producteditdate") %>'>
                                    </asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>

                                    
                                    <asp:LinkButton ID="LinkButton1" runat="server">รายละเอียดสินค้า</asp:LinkButton>
                                </td>


                            </tr>
                        </table>
                       
                    </td>
                </tr>
            </table>
            </div>
            </ItemTemplate>

                     </asp:ListView>


ผมต้องการให้กดที่รายละเอียดแล้วส่งข้อมูลจากfromแรกไปแสดงตาม Label ที่ได้สร้างไว้ โดยเลขบัตรประชาชน
จะเป็น PK แต่ในFromแรกผมโชว์ข้อมูลแค่4อย่างแต่ตอนรับในอีก From จะรับมาโชว์ค่าทุกตัวตามตารางที่เก็บข้อมูล
ในฐานข้อมูล ผมควรทำอย่างไรบ้างศึกษาเรื่องอะไรบ้าง ใช้ even อะไรบ้าง หรือมีตัวอย่างคล้ายๆแบบนี้ ช่วยแนะนำหน่อยคับ
ขอบคุนล่วงหน้าครับ



Tag : .NET, Ms SQL Server 2012, Web (ASP.NET), C#









ประวัติการแก้ไข
2015-10-02 14:20:07
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-10-02 14:18:20 By : aswxsun View : 959 Reply : 4
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ส่งผ่าน HyperLink ครับ จากนั้นใช้พวก QueryString รับค่าครับ



Code (C#)
	void ViewData()
	{
		//*** DataTable ***//
		SqlDataAdapter dtAdapter;
		DataTable dt = new DataTable();
		strSQL = "SELECT * FROM customer WHERE CustomerID = '"+ Request.QueryString["CustomerID"] +"' ";
		dtAdapter = new SqlDataAdapter(strSQL, objConn);
		dtAdapter.Fill(dt);

		if(dt.Rows.Count > 0)
		{
			this.txtCustomerID.Text = (string)dt.Rows[0]["CustomerID"];
			this.txtName.Text = (string)dt.Rows[0]["Name"];
			this.txtEmail.Text = (string)dt.Rows[0]["Email"];
			this.txtCountryCode.Text = (string)dt.Rows[0]["CountryCode"];
			this.txtBudget.Text = (string)dt.Rows[0]["Budget"].ToString();
			this.txtUsed.Text = (string)dt.Rows[0]["Used"].ToString();
		}
	}
    







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-10-02 21:32:04 By : mr.win
 


 

No. 2



โพสกระทู้ ( 9 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณมากๆครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-10-03 15:18:55 By : aswxsun
 

 

No. 3



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-10-03 19:37:42 By : mr.win
 


 

No. 4



โพสกระทู้ ( 9 )
บทความ ( 0 )



สถานะออฟไลน์


ขอโทษนะครับช่วยผมอีกนิดนะคับ พอดีผมเขียนโค้ดตามที่พี่บอกแล้ว แต่เหมือนว่า listview มันไม่อ่านคอนโทลของ label มันต้องแก้ยังไง
หรอครับ และอีกอย่างผมจะส่งรูปไปแสดงที่คอนโทล image ให้from ที่สร้างไว้ต้องส่งยังไงหรอคับ รบกวนด้วยนะคับ ขอบคุนล่วงหน้าครับ

นี้โค้ดตรงที่ไม่อ่านคอนโทลนะคับตรง this.lblidcard.Text,this.lblnameproduct.Text,this.lblprice.Text,this.lbldate.Text ควรแก้ยังไงหรอคับ
Code (C#)
 void ViewData()
        {
            SqlDataAdapter da;
            DataTable dt = new DataTable();
            string cmd = "SELECT Username , Userphone ,CustomerUser.UserIdentification,Useremail,Productname,Productprice,Productdetail,Productpic,Productdate,Producteditdate FROM  CustomerUser  JOIN ProductSecondHand ON CustomerUser.UserIdentification = ProductSecondHand.UserIdentification WHERE ProductSecondHand.UserIdentification = '" + Request.QueryString["UserIdentification"] + "'";
            da = new SqlDataAdapter(cmd, con);
            da.Fill(dt);

            if (dt.Rows.Count > 0)
            {

                this.lblidcard.Text = (string)dt.Rows[0]["UserIdentification"];
                this.lblnameproduct.Text = (string)dt.Rows[0]["Productname"];
                this.lblprice.Text = (string)dt.Rows[0]["Productprice"];
                this.lbldate.Text = (string)dt.Rows[0]["Producteditdate"];
               

            }

          }

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-10-05 10:22:56 By : aswxsun
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ส่งค่าจาก ListView ไปโชว์อีก From นึงโดยกดปุ๋ม LinkButton C# พอดีช่วยแนะนำหน่อยว่าต้องส่งยังไงหรอครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่