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

Can any one tell me why the page gets refreshed when i'm choosing the option from...

hi,
i'm working in asp.net with c#.
i hav one dropdownlist with some options which is similar to Security Questions in yahoo mail.
I hav one option called "If Others". When the user selects this option, one label and textbox will become visible on the form to type for the user.
But the problem is when the user chooses the option "If Others", the page gets refreshed. But i dont want the page to get refreshed.
can any one tell me what i need to do inorder the page not be refreshed. plz.......
Feb 18 '08 #1
3 1059
set autopostback=false in dropdownlist & use javascript to check the value if value="if other" then make textbox visibility true using css display:visible;
Feb 18 '08 #2
r035198x
13,262 8TB
hi,
i'm working in asp.net with c#.
i hav one dropdownlist with some options which is similar to Security Questions in yahoo mail.
I hav one option called "If Others". When the user selects this option, one label and textbox will become visible on the form to type for the user.
But the problem is when the user chooses the option "If Others", the page gets refreshed. But i dont want the page to get refreshed.
can any one tell me what i need to do inorder the page not be refreshed. plz.......
Can you post the code?
Feb 18 '08 #3
<script language="javascript" >

function checkdrop()
{
if(document.getElementById("mydropdown").value=="I f other")
{
document.getElementById("txtdiv").style.display="b lock";
}
}
</script>

<body>
<form id="form1" runat="server">
<asp:DropDownList ID="my_list" runat="server" AutoPostBack="flase" ></asp:DropDownList>
<div id="txtdiv" style="display:none">
<asp:TextBox ID="txt_other" runat="server" />
</div>
</form>
</body>

in codebehind

protected void Page_Load(object sender, EventArgs e)
{
my_list.Attributes.Add("onchange", "javascript:checkdrop();");
}
Feb 18 '08 #4

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

Similar topics

6
by: LisaMark0822 | last post by:
I have an asp page that gets populated from a SQL Server database. Normally when the page gets displayed it displays the current record from a select statement that can return lets say seven...
5
by: Jeronimo Bertran | last post by:
I have a DataGrid that gets filled based on a filter which is defined by the values that the user selects on several controls. When the page postbacks after changing the selection on the filter...
10
by: Nathan Sokalski | last post by:
One thing that I have often needed to do that I have been unable to find a way to do is refresh the page (basically do the same thing as pressing the browser's Refresh button). I know how to do...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
3
by: Tatyana | last post by:
Hello, I was wondering if anybody knows how to disable Email Sending on Page Refresh. When shopper submits the order he/she is being redirected to the receipt page and gets the email...
0
by: arunprabu | last post by:
Hi, I have a problecm with the AJAX request in my webpage. I have some filters on top of the page. I have a submit button and an empty div below the filters. Some of the filters have ajax...
3
by: laryten | last post by:
Hi, Is there a way to update the same web page instead of getting a new page each time we click the submit button? The simplest thing to do is to delete the current page (or go back to the...
18
by: vjayis | last post by:
hi i have a php page in which i have included few tabs links like games, news,entertainment etc., when i click the tablink an ajax page is loaded below. In that ajax page several...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.