Search Results

Search found 729 results on 30 pages for 'postback'.

Page 6/30 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Partial Postback ASP.NET 1.1

    - by Zai
    Hi, I have a ASP.NET web page which is built with .net 1.1 and in GridView the data is displayed as below. This was designed with Delphi studio. There is a discount mechanism for people who selects multiple items from checkboxes and I want when they select multiple items then price is updated but without the complete postback of the page. Any help or suggestions please?

    Read the article

  • Page expiration after postback in ASP.NET

    - by Achilles
    I've been doing web development for a while and have yet to read a good answer to this question: Given a page that executes transactions through a postback, how do you prevent the user from duplicating the transaction when they do something as simple as hit the back button? I've explored trying expire the cache but I must admit I'm lacking in my understanding of ASP.NET caching. What is the approach I should use to make the old request stale and invalid? Thanks!

    Read the article

  • How to read the selected items in an Html.ListBox at postback time

    - by EasyTimer
    I have a search page on my MVC site that contains a list of strings that I think the user might wish to search for in my database. This list of strings is available in my model class, so I can populate an Html.ListBox with those strings thus: <%=Html.ListBox("SearchStrings", new SelectList(Model.SearchStrings)) % My problem is, how can I tell which strings the user selected in that list in my postback action? Any help would be most appreciated.

    Read the article

  • anchor and onclick with asp.net postback

    - by EduardoMello
    I have a link like this <a href="#thumb" id="ctl00_allContent_btnThumb" onclick="javascript:__doPostBack('ctl00$allContent$btnThumb','')"><img alt="" src="../../images/bullet-thumb.gif"></a> On Firefox it does what it supposed to. But it won't work on IE or Chrome. I know there are some questions on the subject here, but they haven't helped me. I'm guessing it's more specific since it envolves ASP.NET postback. thank you

    Read the article

  • MVC Partial View Postback - Jquery validation lost

    - by user415394
    I have a partial view which uses Jquery Valiation. This works OK when initially loaded, however after I do a ajax postback and return the partial view from the server with an error showing, the jquery validation seems to be lost. In that, if I delete a required field and hit save the partial view gets submitted, when I would expect it to show an error message and not get submitted. Does Jquery validation need to be initialised somehow for the form in the partial view?

    Read the article

  • asp.net c# ip address lost after postback?

    - by Mark
    Hi all, One of my functions in a class is called GetIpAddress() which returns the following string: System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] This all works well in regular page loads and gets my ip address, but when i for example let a user place a comment, then the ip address is lost after postback and i get an empty string returned. Am I missing something here maybe? Kind regards, Mark

    Read the article

  • output Caching and postback

    - by Costa
    Hi If you have a button and a text box in a page, and the page is cached on the server. Put a breakpoint at page_load and run If you click the button, the Page_load breakpoint is visited only for first click. I am trying to get some explanation rather than "Wellll....ahhh mmmm it is a postback!!" I am expecting that the breakpoint will not be visited at all, it is a cached page. thanks

    Read the article

  • access values of controls dynamically created on postback

    - by userk
    Hi, My problem is: I've got a table, dynamically created, fill with a lot of dropdownlists witches IDs are dynamically created. When a button is pressed, I need to scan all controls in the table and save their value. But after the postback I can't no longer access to the table, and I've no idea how can I get those values... Thanks!

    Read the article

  • ASP.NET how to use __doPostBack from Custom JavaScript with Master/Content Pages

    - by harrije
    In a simple aspx page I can have a custom JavaScript function postback as described in http://www.xefteri.com/articles/show.cfm?id=18 The simple page uses a linkbutton: <asp:LinkButton id="CreateFile" runat="server" onclick="CreateFile_Click" /> with code behind that has the VB subroutine: Sub CreateFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) and a Javascript custom function that does: __doPostBack('CreateFile',''); When I move the code to a content page with a corresponding master page the simple example no longer works. I'm aware that server control IDs are changed in the generated HTML when a master page is involved, and I'm using the correct IDs in the Javascript. As an example, for the LinkButton ID I use '<%=CreateFile.ClientID%' for the Javascript in the generated HTML. Never the less, I still can't figure out how to get postbacks from the Javascript when master pages are involved. More accurately, with a master page in the mix the code won't even compile but results in: 'CreateFile_Click' is not a member of 'ASP.testmaster_aspx' If I remove onclick="CreateFile_Click" from the LinkButton markup it compiles but does not work. Similary if onclick is removed from the simpler version without a master page it does not work either, as expected. Any input on how to get postback from a custom Javascript function when using master pages would be much appreciated.

    Read the article

  • Dynamically created "CheckBoxList" in placeholder controls throwing null reference exception error d

    - by newName
    I have a web form that will dynamically create a number of checkboxlist filled with data based on the number of row in database. Then this is added to a placeholder to be displayed. theres a button when clicked, will add the selected check boxes value into database but right now when the button is clicked and after the postback, the page will show the error "System.NullReferenceException". the following code is written in Page_Load in (!Page.IsNotPostBack) and in a loop that will dynamically create a number of checkboxlist: CheckBoxLis chkContent = new CheckBoxList(); chkContent.ID = chkIDString; //chkIDString is an incremental int based on the row count chkContent.RepeatDirection = RepeatDirection.Horizontal; foreach (List<t> contentList in List<t>) //data retrieved as List<t> using LINQ { ListItem contents = new ListItem(); contents.Text = contentList.Title; contents.Value = contentList.contentID.ToString(); chkContent.Items.Add(contents); } plcSchool.Controls.Add(chkContent); //plcSchool is my placeholder plcSchool.Controls.Add(new LiteralControl("<br>")); protected void btnAdd_Click(object sender, EventArgs e) { CheckBoxList cbl = Page.FindControl("chkContent4") as CheckBoxList; Response.Write(cbl.SelectedValue.ToString()); // now im just testing to get the value from one of the checkboxlist } Anyone able to help, as it seems the controls are not recreated after the postback, therefore it can't find the control and throwing the null reference exception.

    Read the article

  • Inside what the TexBox value is posted back? ViewState or post back data?

    - by burak ozdogan
    In one article I was reading on ViewState, I saw a sentence saying that I should not fall into a mistake to believe that the value of a TextBox is stored in ViewState; it is stored in PostBack data. From here what I understand is when I post back a web form, the input controls values are stored in HTTP Request body. Not in the Viewstate. But as far as I know ViewState values are stored in an hidden field called __VIEWSTATE anyway. Then does it mean that __VIEVSTATE value is not posted in HTTP POST Request body as a postback data? Sounds nonesense to me. In another words, basically if I say the ViewState mechanism for such scenerio works like this, am I seeing it right or skipping something: You enter a value on an empty TextBox and submit the page The value of text box is posted back inside POST HTTP Request body. Nothing inside __VIEWSTATE at this point from the TextBox On the server side, the TextBox is created with the default value on OnInit method of the page The TrackChange property of ViewState is set to true. The posted back data of TextBox is loaded. Because it is different than the TextBox defalut value(because the user entered something), the ViewState of this text box is marked as DIRTY. The new value of the textbox is written into __VIEWSTATE hidden field From now on __VIEWSTATE hiddenfeild contains the last given value of the TextBox The page is sent to the user's browser having the __VIEWSTATE hidden field. But this time containing the last value entered by user which will be ready to be rendered Thanks guys! burak ozdogan

    Read the article

  • List getting cleared every button click inside Update Panel?

    - by sah302
    No this isn't a copy of this question: http://stackoverflow.com/questions/654423/button-in-update-panel-is-doing-a-full-postback I've got a drop down inside an update panel, and I am trying to get it to allow the person using the page to add users to a list that is bound to a gridview. The list is a global variable, and on page_load I set that to the gridview's datasource and databind it. However, anytime I click the 'add a user' button, or the button to remove the user from the list. It appears like it is doing a full post back even though all these elements are inside the update Panel. Code Behind: Public accomplishmentTypeDao As New AccomplishmentTypeDao() Public accomplishmentDao As New AccomplishmentDao() Public userDao As New UserDao() Public facultyDictionary As New Dictionary(Of Guid, String) Public facultyList As New List(Of User) Public associatedFaculty As New List(Of User) Public facultyId As New Guid Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Page.Title = "Add a New Faculty Accomplishment" ddlAccomplishmentType.DataSource = accomplishmentTypeDao.getEntireTable() ddlAccomplishmentType.DataTextField = "Name" ddlAccomplishmentType.DataValueField = "Id" ddlAccomplishmentType.DataBind() facultyList = userDao.getListOfUsersByUserGroupName("Faculty") For Each faculty As User In facultyList facultyDictionary.Add(faculty.Id, faculty.LastName & ", " & faculty.FirstName) Next If Not Page.IsPostBack Then ddlFacultyList.DataSource = facultyDictionary ddlFacultyList.DataTextField = "Value" ddlFacultyList.DataValueField = "Key" ddlFacultyList.DataBind() End If gvAssociatedUsers.DataSource = associatedFaculty gvAssociatedUsers.DataBind() End Sub Protected Sub deleteUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) facultyId = New Guid(e.CommandArgument.ToString()) associatedFaculty.Remove(associatedFaculty.Find(Function(user) user.Id = facultyId)) gvAssociatedUsers.DataBind() upAssociatedFaculty.Update() End Sub Protected Sub btnAddUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddUser.Click facultyId = New Guid(ddlFacultyList.SelectedValue) associatedFaculty.Add(facultyList.Find(Function(user) user.Id = facultyId)) gvAssociatedUsers.DataBind() upAssociatedFaculty.Update() End Sub Markup: <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="upAssociatedFaculty" runat="server" UpdateMode="Conditional"> <ContentTemplate> <p><b>Created By:</b> <asp:Label ID="lblCreatedBy" runat="server"></asp:Label></p> <p><b>Accomplishment Type: </b><asp:DropDownList ID="ddlAccomplishmentType" runat="server"></asp:DropDownList></p> <p><b>Accomplishment Applies To: </b><asp:DropDownList ID="ddlFacultyList" runat="server"></asp:DropDownList> &nbsp;<asp:Button ID="btnAddUser" runat="server" Text="Add Faculty" /></p> <p> <asp:GridView ID="gvAssociatedUsers" runat="server" AutoGenerateColumns="false" GridLines="None" ShowHeader="false"> <Columns> <asp:BoundField DataField="Id" HeaderText="Id" Visible="False" /> <asp:TemplateField ShowHeader="False"> <ItemTemplate> <span style="margin-left: 15px;"> <p><%#Eval("LastName")%>, <%#Eval("FirstName")%> <asp:Button ID="btnUnassignUser" runat="server" CausesValidation="false" CommandArgument='<%# Eval("Id") %>' CommandName="Delete" OnCommand="deleteUser" Text='Remove' /></p> </span> </ItemTemplate> </asp:TemplateField> </Columns> <EmptyDataTemplate> <em>There are currently no faculty associated with this accomplishment.</em> </EmptyDataTemplate> </asp:GridView> </p> </ContentTemplate> </asp:UpdatePanel> Now I thought the point of an update panel was to be able to update things inside of it without doing a full post_back and reloading the page. So if that's the case, why is it calling page_load everytime I click the buttons? I ran this code and debug and I see that even before any of the code associated with button press fires, page_load runs again. I tried putting the gvAssociatedUser.Datasource = associatedFaculty and the line below inside the Page.IsPostBack check, that prevented the page from working. I tried every combination of settings of the update panel for ChildrenAsTriggers and UpdateMode, and none of them worked. I know this is something simple, but all the combinations I've tried won't get it to work. How can I make this thing work? Edited: It wasn't causing a full postback so I was wrong as to the cause. I thought the page was doing a full post back thus resetting my associatedFaculty list global variable, but it isn't doing a full postback. The issue I am having is everytime I click btnAddUser it will add one element to the associatedFaculty list and thus bound to gvAssociatedusers. This works the first time, but the second time I click it, it overwrites the first element. So it appears like my associatedFaculty list is getting reset each time I click the button?

    Read the article

  • CalendarExtender postback problem

    - by senzacionale
    <asp:TextBox ID="txtDate" runat="server" AutoPostBack="true" OnTextChanged="txtDate_TextChanged"></asp:TextBox> <asp:CalendarExtender ID="txtDate_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtDate" Format="dd.MM.yyyy"> </asp:CalendarExtender> i am using Calendarextender and i OnTextChanged event. In C# code (Page_Load) i am calling txtDate.Text = DateTime.Today.ToShortDateString(); becouse of this i get postback after page is loaded (page is loaded 2 times). How can i prevent postbak in calendar extender after page is loaded for first time?

    Read the article

  • Clicking DetailsView’s Update button doesn’t cause a postback

    - by AspOnMyNet
    If I define the following template inside DetailsView, then upon clicking an Update or Insert button, the page is posted back to the server: <EditItemTemplate> <asp:TextBox ID="txtDate" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox> <asp:CompareValidator ID="valDateType" runat="server" ControlToValidate="txtDate" Type="Date" Operator="DataTypeCheck" Display="Dynamic" >*</asp:CompareValidator> </EditItemTemplate> But if I remove CompareValidator control from the above code, then for some reason clicking an Update or Insert button doesn’t cause a postback...instead nothing happens: <EditItemTemplate> <asp:TextBox ID="txtDate" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox> </EditItemTemplate> Any idea why page doesn't get posted back? thanx

    Read the article

  • Asp.net fileupload control postback problems

    - by Spooky2010
    using ASP.net, vs2008 C#. Im using a FileUpload control on a webform. The uploading of a file (ie PDF dcouments) to a server directory works ok. I have on the webform a "preview" button that the user can use to preview the PDF file after they have selected it via the Fileupload browse feature. I do this by if (this.FileUpload1.HasFile) { localURL = FileUpload1.PostedFile.FileName; // use this to preview file. Other methods are restricted by local security requirements Process.Start(localURL); } My problems is that after the button click Postback occurs the location of the selected file disappears from the textbox part of the Fileupload control. How can i keep this info there, so the user does not have to browse again and instead can just click upload to upload the file. Any help appreciated thanks

    Read the article

  • How to call postback using javascript on ASP.NET form

    - by Anton
    I have a web form with textbox and button. I want after "ENTER" key click on textbox postbak form. I am using next code: onkeypress=" if(event.keyCode==13) { alert(2); WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false)); alert(2); return false;} where WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false)); is javascript code for button event onclick. I get two alerts, but postback doesnot happen. Any ideas what is wrong?

    Read the article

  • Dynamic controls lost when postback

    - by Joren
    Hi I load my self-made webuser controls dynamically. A user chooses a template and depending on that template I load some self-made webuser controls (.ascx) that are defined in a sql server database. When the user fills in the TextBoxes and clicks on the submit button, the entries in the TextBoxes should be saved in my database. The problem is that when clicking the submit button, the TextBox entries are erased. I searched a lot to fix this problem, for example I tried to load every control again every postback by putting the code in the Page_Init event but unfortunately it won't work.

    Read the article

  • Postback problem? Not getting data back from DB

    - by Jason Shultz
    I'm not getting back data from my DB like I'm expecting. I know that I can get data from the DB because I have other functions working. With this page, what I'm trying to do is the following: If no postback, then I would like it to echo "No Category Selected" If a category has been chosen, then I would like for it to get that data from the DB and show it on the page. I'm sure I can do this all in one view, I'm just not doing something right. Can someone help please? Pastebin: http://pastebin.com/AQqcvnAb

    Read the article

  • Strange tab ordering when creating controls after postback

    - by Crackerjack
    I have a button that opens a panel in a popup window and then performs a postback to retrieve data from the server and render some controls. Some of the controls are textboxes and some are dropdown lists and can be in any order. Everything works fine when tabbing through the textbox controls. But when tabbing from the first dropdown contorl found, the tab order 'gets lost' and it starts tabbing from the first control again. When I tab to the same dropdown list the second time 'round, it correctly tabs to the next control. Does anyone know what might be going on? Example: TextBox1 (Tab -> focus set to 'TextBox2') TextBox2 (Tab -> focus set to 'DropDown1') DropDown1 (Tab -> focus goes back up to 'TextBox1' - wtf?) TextBox3 Update: The TabIndex attribute is set on all controls.

    Read the article

  • ajaxtabcontainer with button postback problem

    - by yousof
    I have a dropdownlist in my web page and two command buttons and a tabcontainer. The tabcontainer does not appear after the load of page according to my code. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then TabContainer1.Visible = False If CtvAct.GetRecords("Fill_RequestTypeTb") = True Then ReqTypeCmbo.DataSource = CtvAct.MainDataset.Tables("tbOLRequestType").DefaultView ReqTypeCmbo.DataTextField = "RequestTypeName" ReqTypeCmbo.DataValueField = "RequestTypeId" ReqTypeCmbo.DataBind() Dim itm As New ListItem itm.Text = "-- ??? ??? ????? --" itm.Value = "-1" itm.Selected = True ReqTypeCmbo.Items.Insert(0, itm) ReqTypeCmbo.SelectedIndex = 0 End If End If End Sub Protected Sub PrntCmd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PrntCmd.Click TextBox6.Text = "gggg" End Sub If I press any button after page load the button work very selecting any item from dropdownlist make the tabcontainer appear but after the tabcontainer appear, the buttons does not work (postback) how can I solve these problems

    Read the article

  • Reload external javascript after asynchronous postback via UpdatePanel

    - by Protector one
    I have an external javascript on my page, e.g. something like: <script src="http://foo.com/script.js" type="text/javascript"></script> and an UpdatePanel somewhere. The script writes some content, and does this from within an anonymous javascript function in the js file. I.e., there is something like this in the script: (function(){document.write('content');})(); Whenever the UpdatePanel is updated through asynchronous postback, everything the script did (or any javascript on my page, for that matter) is made undone. For normal javascript, I would just use: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(myFunction) to redo all that, but since the function in the script source file is anonymous and called upon definition, I'm SOL! Any ideas? Note: the external js source is from another domain and its content is out of my control.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >