473,804 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

6 New Member
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 1113
anandnat
2 New Member
set autopostback=fa lse 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 MVP
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
anandnat
2 New Member
<script language="javas cript" >

function checkdrop()
{
if(document.get ElementById("my dropdown").valu e=="If other")
{
document.getEle mentById("txtdi v").style.displ ay="block";
}
}
</script>

<body>
<form id="form1" runat="server">
<asp:DropDownLi st ID="my_list" runat="server" AutoPostBack="f lase" ></asp:DropDownLis t>
<div id="txtdiv" style="display: none">
<asp:TextBox ID="txt_other" runat="server" />
</div>
</form>
</body>

in codebehind

protected void Page_Load(objec t sender, EventArgs e)
{
my_list.Attribu tes.Add("onchan ge", "javascript:che ckdrop();");
}
Feb 18 '08 #4

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

Similar topics

6
1224
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 records. The problem I am having is when I click the refresh button in IE, the page displays another record instead of the record it was displaying before I clicked on the refresh button. I cannot figure out why it is doing this. Has anyone...
5
4479
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 controls, the DataGrid refreshes itslef. Now, I also need to refresh the DataGrid if I detect that something "external" has changed (keeping the filter that the user is using). For this, I have created a page that partially refreshes itslef in...
10
2212
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 this using Javascript/JScript, but I have situations in which I need it to be done immediately after code that is part of my other code. Is there any way to do this? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
6
4906
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
3
1698
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 confirmation, which is being send once the last page in Order Process displayed (Receipt page). Shopper is allowed to refresh that page since the data has been inserted on the previous page. The only problem I have is that the email is being sent every time...
0
1834
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 requests to update the content within the filters. For example, I have 2 drop downs, one for state and another for country. When I select a country in the country drop down, an ajax request is sent to fetch appropriate list of states and updates the
3
5309
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 previous page) and then redraw the page. There are a few possible solutions: 1. Use the same URL again. But a new page will still be created. 2. Use the "onsubmit" option:
18
2725
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 pages(iframes) are loaded inside the tables, such that it contains three tables in a row. each table contains different pages loaded through iframes, and an close button is available so that we can close the unwanted tables(containing frames).
10
2149
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 Master pages as their master...) the entire page is refreshed - also the menu which belongs to the master, how can I fix it - so only the inside content will be refreshed ?
0
9715
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10097
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.