You must Sign In to post a response.
  • Category: ASP.NET

    How to Change TextBox Or Label Value by DropDown SelectedValue Without PageLoad in

    Hi Developers,

    I need to Perform following task.
    There is a page called sample.i have dropdown list with some City Name.

    If i select Chennai in dropdown na Rate Should be 1000
    if i Select Mumbai in dropdown na Rate Should be 2000
    This is Changes when user Selecting dropdown Value But The Page is did not Loaded.

    i need to perform this event Without Pageload.

    if anyone of you know please help me to i am done this task.

    Thanking You
  • #766946
    You have to call ajax request client and server page functionality you can redirect the page to another page with ajax request and response will be back to the original event without calling the pageload event of that particular page.

  • #766947
    Below url is an apt solution for your question please refer it.


  • #766953
    If you want to handle this in the Javascript dropdown, you can use the property "dependentvalue"
    Following is the way to add the dependent values in the dropdown control. You can add the multiple value using the ";" splitter.

    var oOption = document.createElement("OPTION");
    oOption.value = value;
    oOption.setAttribute("dependentvalue", "Your value");

    you can get the dependent value as follows


    By Nathan
    Direction is important than speed

  • #766961
    according to Page life cycle, when you execute any request (postback) page gets destroyed and re-created again, and the code you write on server side (code behind) is executed after page_load only, so here I think you have write code on 'combo_selectedIndexChanged' event
    To avoid postback either you need to use UpdatePanel or use client side scripting to fill gridview
    UpdatePanel controls work by specifying regions of a page that can be updated without refreshing the whole page. This process is coordinated by the ScriptManager server control and the client PageRequestManager class
    use below link

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #766962
    Hi Paul,

    As per my understanding you want to stop the post back of the page after selecting item in dropdown, my suggestion use AJAX UpdatePanel and use Triggers for stop to postback, use AsyncPostBackTrigger template and pass the EventName which event you want to stop postback.


    <asp:UpdatePanel ID="upCancel" runat="server" UpdateMode="Always">
    <asp:ImageButton ID="btnCancelYes" OnClick="btnCancelYes_Click" runat="server"
    ImageUrl="~/Images/btnyes.jpg" />
    <a href="javascript:void(0)" onclick="closepopup()">
    <img src="~/Images/btnNo.jpg" style="border: 0px" align="right" /></a>
    <asp:AsyncPostBackTrigger ControlID="btnCancelYes" EventName="Click" />

    Use the above sample and implement the same in your case.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #766965
    You do this using javascript.
    First make AutoPostBack property =false for dropdown and call javascript function onchange as follows.

    <script type="text/javascript">
    function xyz()
    document.getElementById("TextBox1").innerText = document.getElementById("ddlDemo").value;
    <asp:DropDownList runat="server" ID="ddlDemo" AutoPostBack="false" onchange="javascript:return xyz();">
    <asp:ListItem Text="" />
    <asp:ListItem Text="text1" />
    <asp:ListItem Text="text2" />

  • #766966
    Thanks , thanks a lot for all of your Kindful replies dear friends.
    You are always helping me.

  • #766978

    you can use client side script(Jscript) for this task
    I work and post this code try and let me know.

    <html xmlns="">
    <head runat="server">

    function Jscriptvalues() {
    var cval = document.getElementById("DDLCITY").value;
    if (cval == 1) {
    document.getElementById("TxtAmount").value = 1000;
    else {
    if (cval == 2) {
    document.getElementById("TxtAmount").value = 2000;

    <form id="form1" runat="server">
    <asp:DropDownList ID="DDLCITY" runat="server" onchange="return Jscriptvalues();">
    <asp:ListItem Text="-Select-" Value="0">-Select-</asp:ListItem>
    <asp:ListItem Text="Chennai" Value="1">Chennai</asp:ListItem>
    <asp:ListItem Text="Mumbai" Value="2">Mumbai</asp:ListItem>
    <asp:TextBox ID="TxtAmount" runat="server"></asp:TextBox>

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • Sign In to post your comments