ÎÊÒ»¸ö¼òµ¥¹ØÓÚÔÚASP.NET ת»» numeric
ÎÊÒ»¸ö¼òµ¥µÄÎÊÌ⣬ÔÚÕâµÀ³ÌÐòÀïÃæ
string goodsName = this.GridView1.DataKeys[e.RowIndex][0].ToString();
string salePrice = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text.ToString();
string discount = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[2].Controls[0]).Text.ToString();
salePrice discount¶ÔÓ¦µÄÊý¾Ý¿â ÀàÐÍÊÇnumeric ,µ«ÎÒÔÚÕâÀï²»ÖªµÀÓ¦¸ÃÔõô°ÑstringÈ¥°ÑËüת»»ÎªÊý¾Ý¿âËùÐèÒªµÄnumeric
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace WebTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void getData()
{
SqlConnection cn = new SqlConnection("server=localhost;database=student;user=xie;password=xie");
SqlCommand cmd = new SqlCommand("select*from goods", cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "goods");
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.DataBind();
}
protected void Button1_Click(objec
Ïà¹ØÎÊ´ð£º
asp.net repeater ¿Ø¼þÔõô¿ÉÒÔÈ¡µ½×ӿؼþµÄÖµ£¬ÉèÖöϵãÔÚ ItemDataBound ʼþÔõôûÓÐÓõÄ
Request.Form["name"]
Â¥Ö÷ÄãÒªÔÚ°ÑrepeaterÖÐµÄ Ò»¸öÊôÐÔÉèÖÃһϲÅÄܽøÈëitemdataboundʼþ
¿ÉÒÔ ......
±¾ÈËÔÚ±±¾©,ÐÕ³Â
ÓÐ2ÄêÒÔÉϹ¤×÷¾Ñé.
ÓÐÐèÒªµÄÇëÁªÏµ13683175921,´ýÓöÏê̸.
(·Ç³ÏÎðÈÅ!)
Good Luck£¡~ ÓÑÇéUp£¡~
How Much? ~ ÓÑÇéUp£¡~
Óе㱯¾ç°¡
ÓÑÇéUp£¡~
ÈÕ×ÓÄѻ찡
Ö§³ÖÂ¥Ö ......
ÎÒÒѽ«Windows¿Ø¼þ³É¹¦Ó¦ÓÃÓÚAsp.netÖУ¬µ«Õâ¸ö¿Ø¼þ»¹Òª·ÃÎÊÊý¾Ý¿â¡¢½øÐб¾µØIO²Ù×÷¡¢´òÓ¡µÈ£¬Õâʱ¾Í»á³öÏÖ¡°Ó¦ÓóÌÐòÊÔͼִÐа²È«²ßÂÔ²»ÔÊÐíµÄ²Ù×÷¡±ÕâÑùµÄÌáʾ£¬Ó¦¸ÃÔõÑù¸øËüÊÚȨ£¿
ÔÚ¿Í»§¶ËÒªÅäÖÃ,ÔÊÐí¿Í»§¶ËÈ ......
ÎÒÔÚ Page_Load ÀïдÁË
if(!IsPostBack){
GridView1.DataSource=GroupManager.GetGroups();//GetGroups ·µ»ØµÄÊÇ IList<Group>
GridView1.DataBind();
}
¿ÉÎÒÔÚ Submit_Click Àïд´ú ......
ÓÃDWдµÄaspxºÍvs C#дµÄÍøÕ¾ÏµÍ³(Ö÷ÒªÒ³ÃæÎļþÒ²ÊÇaspxµÄÎļþ)ÓÐÊ²Ã´Çø±ð,VSдµÄÍøÕ¾·¢²¼ºó,ËùÓеĴúÂ벿·ÖºÏ³ÉÒ»¸öDLLÎļþ,¶øDW¾ÍûÓа취,ÕâÁ½¸ö¹¤¾ßд³öÀ´µÄÍøÕ¾Í¬ÑùÊÇaspxµÄÎļþ,µ«Çø±ðºÜ´ó°¡.
°ïÄã¶¥ÏÂ~£¬Çó ......