|
|
foreach statement cannot operate on variables of type 'System.Web.UI.HtmlControls.HtmlTableRow' because 'System.Web.UI.HtmlControls.HtmlTableRow' does not contain a definition for 'GetEnumerator', or it is inaccessible
Gautham
|
|
|
|
|
Please post the exact error message and actual code. this will help us to solve your problem.
Regards,
Mark
|
|
|
|
|
hi
If you know the ID of the HtmlTable where the textboxes are available you can do it as
<br />
<br />
HtmlForm form = (HtmlForm)Page.FindControl("Form1");<br />
HtmlTable tbl = (HtmlTable)form.FindControl("Table2");<br />
<br />
foreach(HtmlTableRow row in tbl.Rows)<br />
{<br />
foreach(HtmlTableCell cell in row.Cells)<br />
{<br />
foreach(Control ctrl in cell.Controls)<br />
{<br />
if(ctrl is TextBox)<br />
{<br />
((TextBox)ctrl).Text = "";<br />
}<br />
}<br />
}<br />
}<br />
<br />
This will work..But you need to know the ID of the table which contains the Textbox controls to be cleared
|
|
|
|
|
HtmlForm form = (HtmlForm)Page.FindControl("Form1");
HtmlTable table1=(HtmlTable)form.FindControl("table1");
for(int i=0;i<table1.rows.count;i++)
{
="" foreach(htmltablerow="" tr="" in="" table1.rows[i])
="" foreach(htmltablecell="" tc="" tr.cells[i+2])
="" foreach(controls="" cont="" tc.controls)
="" if(cont="=TextBox)
" ((textbox)cont).text="" ;
="" }
="" }
error:=""
foreach="" statement="" cannot="" operate="" on="" variables="" of="" type="" 'system.web.ui.htmlcontrols.htmltablerow'="" because="" does="" not="" contain="" a="" definition="" for="" 'getenumerator',="" or="" it="" is="" inaccessible
=""
<div="" class="ForumSig">Gautham
|
|
|
|
|
for(int i=0;i<table1.Rows.Count;i++)
{
for(int j=0;j<table1.Rows[i].Cells.Count;j++)
{
foreach(Controls cont in table1.Rows[i].Cells.Controls)
{
if(cont==TextBox)
((TextBox)cont).Text="";
}
}
}
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Just use the code what i have pasted because that code is working fine.
Try and let me know
|
|
|
|
|
Hi,
I'm using ASP.NET Integrated Windows Authentication for my Intranet site. If a user logs in, I like to provide the option of "Login as Another User". If the user selects the option, I need to prompt the user for User name and password (like basic windows authentication) and provide access.
Pls help how to implement the same.
Thanks in advance
rgds,
Prabhu
|
|
|
|
|
Hi!
I've created a application using ASP.net(c#),so i need some work on crystal reports,for that i've created the DataSet using TableAdapter and that contain a storedProcedure in my DataAccessLayer,in my Business layer i access that TableAdapter and return the reportdocument,this is my process of creating reports,so my problem is i want display some addresses in block wise,like this as follows,
aaaaaaa aaaaaa aaaaaa
bbbbbbb bbbbbb bbbbbb
ccccccc cccccc cccccc
like this that should shows as colomn and row ,can some one help me to that,This is Urgent
|
|
|
|
|
Dear Friend,
I developed my web sites using virsion VS.Net 2003 and I upload relevant folder (wwwroot/myproject like that) all files to server. It contain BIM folder also. Then it's properly work.
But my problum is I developed another site using VS.Net 2005. I can save web project files in anywhere in computer In 2005. It's local server properly run. If that site properly work in the server, Which files am I upload to server?
Regards
Kusal
|
|
|
|
|
copy the corresponding virtual directory.
Then use them in the server.
Before upload publish the web application
Sathesh Pandian
|
|
|
|
|
Dear Sathesh
Thanks for reply
Regards
Kusal
|
|
|
|
|
If you want to publish your site to different server or virtual directory it's better to use the "Copy Web Site" or "Publish Web Site" tools from the .NET 2005 (IDE).
Regards,
Mark
|
|
|
|
|
Dear Mark,
Thanks for reply
Regards
Kusal
|
|
|
|
|
I'm deploying my app to a SQL 2005 server and was not paying attention when I setup my database for users, I used the ASP.net configuration tool and it created the aspnetdb.mdf database and stored the users there. I already had a database that I had setup my tables and ran the aspnet_sqlreg.exe on, thinking that VS2005 would see that the database was already setup for asp.net and use it, it did not.... and now I have deleted the aspnetdb and not sure how I can get the forms and the asp.net config to look at my database i created.
|
|
|
|
|
Hi All,
Can anyone please help me on page design and integrate
master page, tabmenu and gridview control?
I have page that :
1. On top should be Tab menu like HOME,PROCESS,HR
2. When u click on PROCESS TAB, On Leftside of same
page should display PROCESS TREEVIEW WITH SOME
TREENODE-CHILD NODE DATA
3.When u click on child node, ON CENTER OF SAME PAGE,
should display gridview control (full-featured
gridview control)
I have created individual examples of TABMENU,
Treeview and Gridview control but i can't integrate
them.
I thought I will use Frames and IBUYSPY Design
concepts BUT IN ASP.NET 2.0 IT IS NOT WISE TO USE
FRAME AND FRAMES ARE NOT SUPPORTED WELL
NOW I AM IN COMPLETE CONFUSION TO MAKE ALL PEICES TO
WORK AS ONE WEBPAGE.
PLEASE HELP.
Ami Dalwadi
|
|
|
|
|
I really don't get what the problem is. What bit is confusing you ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hai,
Its simple,
put all that parts you have made has a usercontrol and create a master page.
create pages and use the master page, write appropriate code to do the business logic. there are lot of examples available in net.
Cheers
asithangae
|
|
|
|
|
how I can make my website send and recieve emails in asp 2.0 plz replay quickly
thanks for advance
let's work together
|
|
|
|
|
Try to use this
string from = "from@from.com";
string to = "to@to.com";
string subject = "UtilMailMessage001";
string body = "UtilMailMessage001 - success";
System.Web.Mail.SmtpMail.SmtpServer = "MyMailServer";
System.Web.Mail.SmtpMail.Send(from, to, subject, body);
Regards,
Mark
|
|
|
|
|
Hi, I got stuck in a problem and don't know what to do. In my aspx form. I am displaying a ModalPopup window(Ajax) when a I click on a link button. It was working fine till now when i added a flash image in the center of my form. So the form is loaded and flash image is loaded too but when i do click on the link button the background got disabled which is correct and that's how the modalpopup works but the modalpop window is now behind the flash object i want it to be on the top of the the image whenever i do click on a link button .
Please help
Thanks
|
|
|
|
|
Hai,
decrease the zIndex property of flash container and also keep the focus on new modal box.
asithangae
|
|
|
|
|
Hi, thanks for replying. Can you please provide me some example as i am a newbie. how can i decrease zindex of my flash object. How can i decrease zindex in my webform for flash.
Thanks
|
|
|
|
|
|
Thank you so much that's exactly what i was looking.
|
|
|
|