.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Post back puzzle

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Hi, I have a website where the user makes a selection from a combo box and it then fills a couple text boxes with text based upon the selection. I'm sure as you know it could take a second for the text to appear in the text box due to the post back. I know there is no way to make it instantanious, so what I would like to do it fill the text box with somthing like "Loading Info..." so the user does not type in it while the information is loading.

If you would like to see what I mean please go to this page: www.epiclinks.com/create.aspx and mess around with the combo boxes and You'll see what I mean.

What I would like to do is have it do a post back to write "Loading Info..." and then do another post back to fill it in based upon their selection. How would I do this?

I'm up for anything, so if you have a better solution than that please let me know.


View Complete Post

More Related Resource Links

checkboxlist full post back problem is association with PopupControlExtender


I have used a checkboxlist in association with PopupControlExtender. All the items are inside the update panel. I used the server side SelectedIndex changed event of checkbox list for another purpose.  But it cause full post back while checking the check box item. The update panel doent make any sense here.

        <asp:ScriptManager ID="Scriptmanager1" runat="server">
        <asp:UpdatePanel ID="UpdatePanel3" runat="server">

ScriptManager.RegisterStartupScript is not working after post back

Hi,          I am registering javascript after page  post back using ScriptManager.RegisterStartupScript . it used to work previously. Ater there are some chagnes done in the project now it is not working. What might be the reason behind this. now i am unable to register the javascript after post back.Thanks and Regards,kiran

Cascading drop box holds old value if empty on auto post back

I have 3 drop boxes: 1.) Choose Operation 2.) Choose Site 3.) Choose Area. All three of them are linked to an SQL server database which has 3 tables following the same heiarchy of order. I.e. Areas belong to a Site and Sites belong to an operation. And there can only be one operation per site, or one site per area. First you select an operation, then the page auto postbacks to filter the sites. Then you pick a site and again it autopostbacks to filter the areas. The issue I am having is that when an associated operation has no sites underneight it, and therefore no areas under that, the previous values that were in the boxes are displayed and the user can't click on the boxes anymore. I think this is kind of cheap looking and would like a way to make it so the boxes are clear (i.e. nothin in them). Is there anyway to check if they are going to freeze like that and assign them blank values??Any suggestions on this issue would be greatly appreciated!-Jordan

Dynamic Image Buttons in GridView not doing partial post back

Hi Gurus - Create a gridview with AllowPaging and AllowSorting = true- On page load, I bind it to datasource (in my case a webservice) - On gridview's rowcreated event, I dynamically add image buttons on the header of the grid for sorting (up/down arrows). On header I have column name and the image. I removed the Column name default sorting link. So user can now only click the image button for sorting.-  Call sorting method This works perfectly fine without AJAX. The paging, sorting works fine. Also when I apply AJAX the paging works fine. But the sorting is doing a full post back instead of partial postback. I have my gridview within UpdatePanel and Triggeres is set on gridview sill it doesn't work.ASPX Code<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:Label ID="lblAccount" runat="server" Text="Account #: "></asp:Label> <asp:TextBox ID="txtAccountNumber" runat="server">12203A30</asp:TextBox> <asp:Button ID="cmdGo" runat="server" Text="Go" OnClick="cmdGo_Click" /><br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> &l

Dynamically created controls not accessible after post back.

Dear Friends, pls give the solution. code given below.. dynamically HtmlInputCheckBox created and add in PlaceHolder(panel). I can't get the created control values after post back..Dynamic Control Creationprivate void GetPhotos() { HtmlImage img; HtmlInputCheckBox ic; panel.Controls.Clear(); DataTable dtPhotos = DLayer.Qry_WithDataTable("ADM_GET_HotelPhotos"); foreach(DataRow drPhotos in dtPhotos.Rows) { if ( File.Exists(Server.MapPath("../Photos/Hotel/" + drPhotos["FileName"].ToString()))) { ic = new HtmlInputCheckBox(); ic.Value = drPhotos[0].ToString(); if (drPhotos["PStatus"].ToString() == "1") ic.Checked = true; else ic.Checked = false; panel.Controls.Add(ic); img = new HtmlImage(); img.Src = "~/Photos/Hotel/" + drPhotos["FileName"].ToString(); img.Alt = drPhotos[1].ToString(); img.Attributes.Add("title", drPhotos["PhotoCaption"].ToString()); panel.Controls.Add(img); } } }Get checkbox values foreach (Control ctbl in panel.Controls)        {            if (ctbl is HtmlI

Loading graphics without Ajax on submit and before Post Back

Hi, In order to maintain the view state information, I have decided not to use update panel for the loading image. Instead is there a way where I can simply make an image invisible, and display the image on click of the search button and hide it when the page post back again ?    Please advise.  

How to change from button post back to autopostback

Can anyone help me with how to change from an update button to an autopostback, so that every time the info is changed it will be updated.

<%@ Page language="c#" Inherits="GreetingCardMaker.GreetingCardMaker" CodeFile="NewGreetingCardMaker.aspx.cs" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
		<title>Greeting Card Maker</title>
		<form runat="server">
			<div style="BORDER-RIGHT: thin ridge; PADDING-RIGHT: 20px; BORDER-TOP: thin ridge; PADDING-LEFT: 20px; FONT-SIZE: x-small; PADDING-BOTTOM: 20px; BORDER-LEFT: thin ridge; WIDTH: 293px; PADDING-TOP: 20px; BORDER-BOTTOM: thin ridge; FONT-FAMILY: Verdana; HEIGHT: 486px; BACKGROUND-COLOR: lightyellow">Choose 
				a background color:<br />
				<asp:DropDownList id="lstBackColor" Height="22px" Width="194px" runat="server">

ASP.NET AJAX Post back happening in IE7 but works good in Firefox


Hi all,

I am debugging one of the project which is implemented using .Net Framework 3.5.

in the home page the project has 5 widgets.

In one of the widget contains a two radio buttons and a save button.When ever the user tries to change the Radiobutton option and Save the results will be displayed properly in Firefox.

But in Internet Explorer 7 the page gets a post back and all the widgets will be reloaded and finally the default radio button will be selected as default instead of the option which i selected.

Can any one help me to resolve this issue.

thanks in advance

Link button is not doing post back



I have 2 link button in my page and every thing was working fine until i added window.onload() method on my page.

After adding window.onload() first link button is working but not the second button. I am using update panel in my page

Please help me

function PageTest() { //do some task}

window.onload = PageTest;

<asp:UpdatePanel ID="UpdPanel" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
                <asp:AsyncPostBackTrigger ControlID="linkbutton1" EventName="Click" />
  //some code

Page does not post back when clicking any button

I thought the page was working fine yesterday. Today I added some code in various places and now a click on any button does not post back.

What could I check that has changed? Any suggesyions? Thank you.

FileUpload content after post back


Hello all. I have many file upload controls in my web page. In this page is a add button that create dynamic controls in table rows. Every table row has a file upload control. When this button clicks, post back occurs and all file upload controls content fly and user have to select all of them. What should I do for keep FileUpload content after post back?

Trouble with update panel and dynamic controls and post back


 I have a page that is mostly dynamically built in the page load of my VB.net code behind page.

The issue is that I made a change to the page and added a button that redirects to a secondary page. When the button is clicked there is a very noticeable lag until the button click event fires because the page is being rebuilt every time.

I had not wrapped the code in the load event in the If not ispostback.... because I have dynamic controls that the user interacts with and I need the page to be rebuilt when the user clicks them.

The dynamic controls are clickable table cells. I did some looking and I found that the RegisterPostBackControl. I thought this would be perfect but, it does not although I maybe using it incorrectly.

Here is the code flow.

Page Load

If not ispostback then


end if


private sub setuppage()

'get a reference to the scriptmanager on the master page

Dim scriptManager = DirectCast

Attributes clear on post back


I am using Attributes.Add("style", "color:green") with some checkboxlists and radiobuttonlists.  When I click one of the checkboxes and I do the autopostback the attributes clear out.  So I would think someone already has a sub to fix this.  Something like:


SaveAttributes(checkboxlist1) or SaveAttributes() 'which would loop though all controls and save the state.


and then on pageload it would have

LoadAttributes(checkboxlist1) or LoadAttributes() 'which would loop through all controls and restore the state.



Asp.net Cross Page Post Back issue


Dear All,

I have two web pages, say SourceWebPage and TargetWebPage, on the TargetWebpage I have a directive like:
&lt;%@ PreviousPageType VirtualPath = "~/SourceWebPage.aspx" %&gt;

These are the code behand on TargetWebPage Page_Load Event:

if (!Page.IsPostBack)
                if (Page.PreviousPage != null &amp;&amp; Page.PreviousPage.IsCrossPagePostBack)
                    DateTime reportDate = PreviousPage.DTReportDate;
                    string serialNo = PreviousPage.SerialNo;

Send model back when form post


public ActionResult DisplayView1()


  EmployeeModel myModel = new EmployeeModel();


  return View(myModel);


When I hit the sumit button on the view, that's method of the view is "post". How do I pass the original model back to the action?

<form id="employeeForm" name=employeeForm" action=<%Model.ActionName %> method="post">

<%Model.ActionName %> will be in this example equals "PostBackFromView"

I would like to have this:


public ActionResult PostBackFromView(EmployeeModel model)



What should I do in the view to enable the pass back of the model?


Web part lost when page post back


Here is the brief detail of issue.

1. I have Page1 where I have put LinkButton. The LinkButton Has property PostBackUrl pointing to Page2.

2. When user is redirected to page2, I am using Page Load method to access controls from previous page & get the needed value. To make clear, I am using this approach becuase I cant use querystring.

3. Page 2 has 2 web parts on it. The web parts use data received in Page Load event from page1 and renders data.

4. This works perfect on first page load. When user clicks on a URL in page which posts back, the web parts gets lost.

5. Note that if I come directly to page2 without going at page1, then web parts are retained in the page and they are not lost.

Can anyone give me the clue of issue cause?

Thanks in advance.

All TextBox controls in ASP.NET UpdatePanel won't accept any input after post-back


 My code behind is VB.NET. I use ASP.NET UpdatePanel like the following. However, after the post-back, all textbox in UpdatePanel won't accept any input, except when I move the mouse over and click on the TextBox.

  • Here's why I use UpdatePanel:

    During the post-back, after inserting data into DB, set all TextBox text property to String.Empty

    After the form is submitted, the Panel pStudent should be refresh , not the entire page

    and the TextBox txtId is set in focus again.

It's very strange that this happened to me today. I used UpdatePanel before many time I never had such problem.

Can anyone show me why  all TextBox controls in UpdatePanel won't accept any input after the post-back even though the textbox is focused , only when you move mouse click in them? 

    <asp:UpdatePanel ID="upPOS" runat="server">
            <asp:Panel ID="pStudent" runat="server" CssClass="InContentInfoLight" 
        DefaultButton="btnSubmit" GroupingText="Cafeteria - POS">
                <br />
                <div class ="divleftcolumn-six">
                    ID Number :
                    <asp:TextBox ID
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend