从gridview获取数据的问题... [英] problen in fetching data from the gridview...
问题描述
当我单击DataNavigateUrlFields时,我想获取数据,其中text ="MASTER"
我得到的错误是.....
错误1 System.Web.UI.WebControls.DataControlFieldCollection必须具有类型为``System.Web.UI.WebControls.DataControlField''的项目. ``asp:Label''的类型为``System.Web.UI.WebControls.Label''. F:\ Project \ TelephoneDirectoryApp \ EmpFetch.aspx 42
错误2不允许在"System.Web.UI.WebControls.DataControlFieldCollection"中使用文字内容(''''). F:\ Project \ TelephoneDirectoryApp \ EmpFetch.aspx 42
< asp:gridview id ="grdJobHistory" bordercolor ="AliceBlue"符文=服务器" cellpadding ="4"字体名称="verdana"字体大小=小" forecolor =#333333" gridlines =垂直" xmlns:asp =#unknown"> Width ="100%" AutoGenerateColumns ="False" AllowPaging ="True" OnPageIndexChanging ="grdJobHistory_PageIndexChanging"> < footerstyle backcolor =#5D7B9D" font-bold ="True" forecolor ="White"> < rowstyle backcolor =#f2f9ff" forecolor =#333333"> < editrowstyle backcolor =#999999"> < selectedrowstyle backcolor =#E2DED6" font-bold ="True" forecolor =#333333"> < pagerstyle backcolor =#284775" forecolor ="White" horizontalalign ="Center"> < headerstyle backcolor =#6699cc" font-bold ="True" forecolor ="White"> < alternatingrowstyle backcolor ="White" forecolor =#284775"> <列> < asp:hyperlinkfield datanavigateurlfields ="Ecode,EmployeeName,Designation,Location" datanavigateurlformatstring ="UpdatePage.aspx?ECODE = {0}& ENAME = {1}& DESIGNATION = {2}& LOCATION = {3}" text ="MASTER"> < asp:boundfield datafield ="ECODE" itemstyle-horizontalalign ="Left" headerstyle-horizontalalign ="Left" headertext ="ECODE" sortexpression ="ECODE"> < asp:label id ="LABELCODE" runat ="server" text =<%#Eval(" ecode)="%& gt;" ="="> < asp:boundfield datafield ="EMPLOYEENAME" itemstyle-horizontalalign ="Left" headerstyle-horizontalalign ="Left" headertext ="EMPLOYEENAME" sortexpression ="EMPLOYEENAME"> < asp:boundfield datafield ="DESIGNATION" itemstyle-horizontalalign ="Left" headerstyle-horizontalalign ="Left" headertext ="DESIGNATION" sortexpression ="DESIGNATION"> < asp:boundfield datafield ="LOCATION" itemstyle-horizontalalign ="Left" headerstyle-horizontalalign ="Left" headertext ="LOCATION" sortexpression ="LOCATION"> < asp:templatefield> < pagersettings previouspagetext =上一页" nextpagetext =下一页" firstpagetext =首页" lastpagetext =最后一页"> |
I want to fetch data when i will click on DataNavigateUrlFields where text = "MASTER"
Error i m getting is.....
Error 1 System.Web.UI.WebControls.DataControlFieldCollection must have items of type ''System.Web.UI.WebControls.DataControlField''. ''asp:Label'' is of type ''System.Web.UI.WebControls.Label''. F:\Project\TelephoneDirectoryApp\EmpFetch.aspx 42
Error 2 Literal content ('''') is not allowed within a ''System.Web.UI.WebControls.DataControlFieldCollection''. F:\Project\TelephoneDirectoryApp\EmpFetch.aspx 42
<asp:gridview id="grdJobHistory" bordercolor="AliceBlue" runat="server" cellpadding="4" font-names="verdana" font-size="Small" forecolor="#333333" gridlines="Vertical" xmlns:asp="#unknown"> Width="100%" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="grdJobHistory_PageIndexChanging"> <footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White"> <rowstyle backcolor="#f2f9ff" forecolor="#333333"> <editrowstyle backcolor="#999999"> <selectedrowstyle backcolor="#E2DED6" font-bold="True" forecolor="#333333"> <pagerstyle backcolor="#284775" forecolor="White" horizontalalign="Center"> <headerstyle backcolor="#6699cc" font-bold="True" forecolor="White"> <alternatingrowstyle backcolor="White" forecolor="#284775"> <columns> <asp:hyperlinkfield datanavigateurlfields="Ecode,EmployeeName,Designation,Location" datanavigateurlformatstring="UpdatePage.aspx?ECODE={0}&ENAME={1}&DESIGNATION={2}&LOCATION={3}" text="MASTER"> <asp:boundfield datafield="ECODE" itemstyle-horizontalalign="Left" headerstyle-horizontalalign="Left" headertext="ECODE" sortexpression="ECODE"> <asp:label id="LABELCODE" runat="server" text="<%# Eval(" ecode")="" %>"=""> <asp:boundfield datafield="EMPLOYEENAME" itemstyle-horizontalalign="Left" headerstyle-horizontalalign="Left" headertext="EMPLOYEENAME" sortexpression="EMPLOYEENAME"> <asp:boundfield datafield="DESIGNATION" itemstyle-horizontalalign="Left" headerstyle-horizontalalign="Left" headertext="DESIGNATION" sortexpression="DESIGNATION"> <asp:boundfield datafield="LOCATION" itemstyle-horizontalalign="Left" headerstyle-horizontalalign="Left" headertext="LOCATION" sortexpression="LOCATION"> <asp:templatefield> <pagersettings previouspagetext="Previous" nextpagetext="Next" firstpagetext="First" lastpagetext="Last"> |
推荐答案
你好,
能否请您粘贴一段代码,以便我可以看到您尝试过的内容,并且可以解决您的错误
谢谢与问候
基数
Hello,
Can u please paste in your piece of code so that i can see what u tried and wher''s your mistake
Thanks & Regards
Radix
这篇关于从gridview获取数据的问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!