472,378 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 1640
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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.