473,396 Members | 2,026 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,396 software developers and data experts.

Check state on webform

Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR
Nov 19 '05 #1
9 1720
Is that server side controls or just client side?

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR

Nov 19 '05 #2
ASP.NET is a server side technology. You want to do something on client
side. For this you can just write some javascripts in your aspx file as if
it is a regular html file. All you need to know is what html controls will
represent your server controls on the client. A checkbox will become an
<input type=checkbox> and a ddl will turn into a <select>.

Eliyahu

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR

Nov 19 '05 #3
You can get the client side id for these serverside controls in the code by
using the ClientID attribute for the control. So you can use this to write
the client side code to manipulate this.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
ASP.NET is a server side technology. You want to do something on client
side. For this you can just write some javascripts in your aspx file as if
it is a regular html file. All you need to know is what html controls will
represent your server controls on the client. A checkbox will become an
<input type=checkbox> and a ddl will turn into a <select>.

Eliyahu

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR


Nov 19 '05 #4
On client site change state dropdownlist control, but use value from
dropdownlist on server site after send form to server.

Użytkownik "Gopalan" <go***************@btinternet.com> napisał w wiadomości
news:OS**************@tk2msftngp13.phx.gbl...
Is that server side controls or just client side?

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR


Nov 19 '05 #5
Thx,
but I don't know JavaScript can you help me?
In dropdownlist I use data from dataSet - from sql dataBase - this dynamic
list.

Użytkownik "Eliyahu Goldin" <re*************@monarchmed.com> napisał w
wiadomości news:Os**************@tk2msftngp13.phx.gbl...
ASP.NET is a server side technology. You want to do something on client
side. For this you can just write some javascripts in your aspx file as if
it is a regular html file. All you need to know is what html controls will
represent your server controls on the client. A checkbox will become an
<input type=checkbox> and a ddl will turn into a <select>.

Eliyahu

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR


Nov 19 '05 #6
Try this...

<HTML>
<script language="javascript">
function myCB_CheckedChanged()
{
if (document.getElementById("myCB").checked == true)
document.getElementById("myDDL").disabled = false;
else
document.getElementById("myDDL").disabled = true;
}
</script>
<body>
<form id="Form1" method="post" runat="server">
<asp:CheckBox id="myCB" onclick="myCB_CheckedChanged();" runat="server"
Text="My Check Box" Checked=True />
<br>
<asp:DropDownList id="myDDL" runat="server"/>
</form>
</body>
</HTML>

"PawelR" wrote:
Thx,
but I don't know JavaScript can you help me?
In dropdownlist I use data from dataSet - from sql dataBase - this dynamic
list.

UÂżytkownik "Eliyahu Goldin" <re*************@monarchmed.com> napisaÂł w
wiadomoÂści news:Os**************@tk2msftngp13.phx.gbl...
ASP.NET is a server side technology. You want to do something on client
side. For this you can just write some javascripts in your aspx file as if
it is a regular html file. All you need to know is what html controls will
represent your server controls on the client. A checkbox will become an
<input type=checkbox> and a ddl will turn into a <select>.

Eliyahu

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello group,
I'm begginer in ASP.net and my question is very simple.
In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set
myDDL.Enabled =myCB.Checked and show change without refresh
website (without send formular to server) - run this on client site.
Thx
PawelR



Nov 19 '05 #7
Try this...

<HTML>
<script language="javascript">
function myCB_CheckedChanged()
{
if (document.getElementById("myCB").checked == true)
document.getElementById("myDDL").disabled = false;
else
document.getElementById("myDDL").disabled = true;
}
</script>
<body>
<form id="Form1" method="post" runat="server">
<asp:CheckBox id="myCB" onclick="myCB_CheckedChanged();" runat="server"
Text="My Check Box" Checked=True />
<br>
<asp:DropDownList id="myDDL" runat="server"/>
</form>
</body>
</HTML>
Nov 19 '05 #8
Try this...

<script language="javascript">
function myCB_CheckedChanged()
{
if (document.getElementById("myCB").checked == true)
document.getElementById("myDDL").disabled = false;
else
document.getElementById("myDDL").disabled = true;
}
</script>
<body>
<form id="Form1" method="post" runat="server">
<asp:CheckBox id="myCB" onclick="myCB_CheckedChanged();" runat="server"
Text="My Check Box" Checked="True" />
<br>
<asp:DropDownList id="myDDL" runat="server" />
</form>
</body>
Nov 19 '05 #9
Sorry about the multiple messages, first few responded saying that they were
unsuccessfully sent.
Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: AvailBrad | last post by:
I have a problem with an Asp.net Web Application I have been developing. The project contains multiple asp.net webforms. I have code that I want to only be run when IIS first starts and when the...
2
by: FlashMerlot | last post by:
We have an ASPX (C#) webform which hosts dropdownlists, textboxes, grids, checkboxes, etc. The users want to: #1 - "FREEZE" the entire webpage contents (and state) #2 - move IE browser to...
0
by: Bruno Ferreira | last post by:
Hi! Can someone help me? I have a Webform to register Users Traveller Expenses. To do this I created inside the webform a Custom DataSet, with a Custom DataTable (with some columns) with receives...
1
by: Dan | last post by:
IE WebControls Tab/MultiPage state problem I have a IE tab/multipage on a WebForm (aspx) like this: <code> <iewc:TabStrip id="tabs" runat="server" TargetID="MultiPage1"> <iewc:Tab...
2
by: Vinod I | last post by:
Hi Team, When I tryed following code, I am getting the Runtime Error as "The View State is invalid for this page and might be corrupted." Exception Details: System.Web.HttpException: The View...
0
by: Terry | last post by:
Hi All, I'm having trouble checking in new webform or any type of file into ASP.NET web project's root directory. After I added new file into local SourceSafe controlled project, everytime I...
0
by: Evelin | last post by:
Hi, I use ASP.NET and my problem is I´ve two buttons, a dataSet, a dataGrid and a sqlDataAdpater, I use sqlDataAdapter.fill(dataSet,"dbTable"), then when when the user press the first button, I...
0
by: dotnet_vb_newbie | last post by:
I've developed a provider in VB which extends all textbox controls on a webform. The attributes for all the textbox objects are saved in a HashTable. I'm having a problem figuring out the right way...
9
by: cashdeskmac | last post by:
I have put a string into Session and tried to retrieve it on the next page I visit but the Session appears empty. I have exactly the same spelling for both adding and retrieving the value: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.