473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Hide all controls in a panel in ASP.Net

35
Hi

Simply i want Hide all Textboxes in a Panel ,,, in asp.net

i can do it by C# :

foreach (Control ctrl in Panel1.Controls)
{
if (ctrl is TextBox)
{
((TextBox)(ctrl)).Visible = false;
}

}

Can anyone tell me how to do in JavaScript?
Oct 15 '07 #1
1 988
Hi...
mmmmm try this code...

//where controlName is defined as Control (as parameter)
<script language=""JScript"">
try
{
window.focus();
document.body.focus();
if (document.all(""" & controlName & """).tagName == 'SELECT')
{
document.all(""" & controlName & """).selectedIndex = 0;
document.all(""" & controlName & """).focus();
}
else
{
document.all(""" & controlName & """).select();
document.all(""" & controlName & """).focus();
}
}
catch(e)
{
/**/
}
</script>



regards,
ruel






Hi

Simply i want Hide all Textboxes in a Panel ,,, in asp.net

i can do it by C# :

foreach (Control ctrl in Panel1.Controls)
{
if (ctrl is TextBox)
{
((TextBox)(ctrl)).Visible = false;
}

}

Can anyone tell me how to do in JavaScript?
Oct 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: alexB | last post by:
Panel sucks! I don't use it because it's so quirky. >-----Original Message----- >The panel control seems to be the right tool to group controls on a page, >but I seem to loose all ability to...
0
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
12
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a...
1
by: Jeremy S | last post by:
I want to show or hide a bunch of related controls at runtime (textboxes, labels, check boxes). Is the Panel control the only way to go? Are there alternatives? Thanks.
5
by: dje | last post by:
In the OnClick event on a radioButtonList, I run a javascript to show/hide the appropriate div along with a submit button, which displays as expected. The problem is the submit no longer works on...
2
by: Øyvind Isaksen | last post by:
Is it possible to show/hide a usercontrol code behind? <uc1:topart id="Topart1" runat="server"></uc1:topart> This is what i want to do, but this does not work: if objDR.read me.Topart1.show...
1
by: Aravind | last post by:
Can anyone suggest me how to design auto hide feature for a panel control. I have a few controls in a panel. I want to auto hide them when user is not working with them. Thank you for you help...
2
by: Nathan Sokalski | last post by:
I have an HTML table in which I am using ASP:Panel controls to group together <tr>'s so that I can more easily show/hide them (by setting the ASP:Panel's Visible property). This works fine, but...
2
by: Badass Scotsman | last post by:
Hello, I have two files, default.aspx and default.aspx.cs. On my ASPX file I have the following code: <asp:panel ID="MyPanel" runat="server"> Content Here </asp:panel> And I want to...
1
by: vvgopal2k | last post by:
Hi Group, I am facing a problem in ASP.net usercontrols. Here is the Program. When a Click a button on the usercontrol page, a panel shows up on the same user control, this panel has some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.