Search Results

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

Page 11/30 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Change Action of Checkbox to Get Instead of Post

    - by Shiraz Bhaiji
    We have an ASP.Net page that uses a checkbox to toggle between a list view and a tree view. The problem is that this triggers a post. When we then click on one of the documents in the list, then press back in the browser, we get a page expired error. Is it possible to change the action of the check box to trigger a get with a parameter?

    Read the article

  • How do I simulate the usage of a sequence of web pages?

    - by Rory Becker
    I have a simple sequence of web pages written in ASP.Net 3.5 SP1. Page1 - A Logon Form.... txtUsername, txtPassword and cmdLogon Page2 - A Menu (created using DevExpress ASP.Net controls) Page3 - The page redirected to by the server in the event that the user picks the right menu option in Page2 I would like to create a threaded program to simulate many users trying to use this sequence of pages. I have managed to create a host Winforms app which Launches a new thread for each "User" I have further managed to work out the basics of WebRequest enough to perform a request which retrieves the Logon page itself. Dim Request As HttpWebRequest = TryCast(WebRequest.Create("http://MyURL/Logon.aspx"), HttpWebRequest) Dim Response As HttpWebResponse = TryCast(Request.GetResponse(), HttpWebResponse) Dim ResponseStream As StreamReader = New StreamReader(Response.GetResponseStream(), Encoding.GetEncoding(1252)) Dim HTMLResponse As String = ResponseStream.ReadToEnd() Response.Close() ResponseStream.Close() Next I need to simulate the user having entered information into the 2 TextBoxes and pressing logon.... I have a hunch this requires me to add the right sort of "PostData" to the request. before submitting. However I'm also concerned that "ViewState" may be an issue. Am I correct regarding the PostData? How do I add the postData to the request? Do I need to be concerned about Viewstate? Update: While I appreciate that Selenium or similar products are useful for acceptance testing , I find that they are rather clumsy for what amounts to load testing. I would prefer not to load 100 instances of Firefox or IE in order to simulate 100 users hitting my site. This was the reason I was hoping to take the ASPNet HttpWebRequest route.

    Read the article

  • Has form post behavior changed in modern browsers? (or How are double clicks handled by the browser)

    - by Alex Czarto
    Background: We are in the process of writing a registration/payment page, and our philosophy was to code all validation and error checking on the server side first, and then add client side validation as a second step (un-obstructive jQuery). We wanted to disable double clicks server side, so we wrote some locking, thread-safe code to handle simultaneous posts/race conditions. When we tried to test this, we realized that we could not cause a simultaneous post or race condition to occur. I thought that (in older browsers anyway) double clicking a submit button worked as follows: User double clicks submit button. Browser sends a post on the first click On the second click, browser cancels/ignores initial post, and initiates a second post (before the first post has returned with a response). Browser waits for second post to return, ignoring initial post response. I thought that from the server side it looked like this: Server gets two simultaneous post requests, executes and responds to them both (unaware that no one is listening to the first response). From our testing (FireFox 3.0, IE 8.0) this is what actually happens: User double clicks submit button Browser sends a post for the first click Browser queues up second click, but waits for the response from the first click. Response returns from first click (response is ignored?). Browser sends a post for the second click. So from a server side: Server receives a single post which it executes and responds to. Then, server receives a second request wich it executes and responds to. My question is, has this always worked this way (and I'm losing my mind)? Or is this a new feature in modern browsers that prevents simultaneous posts to be sent to the server? It seems that for server side double click prevention, we don't have to worry about simultaneous posts or race conditions. Only need to worry about queued up posts. Thanks in advance for any feedback / comments. Alex

    Read the article

  • render javascript on partialpostback through ajax

    - by Khushi
    Hi All, I have a grid on a page along with a tooltip for each cell created dynamically on dlDrivers_ItemDataBound event through javacsript. I have been using ajax on my page. When i visit the page for the first time, all the tooltips are working fine but when i perform some actions on the page and grid ispostback through ajax, but the javascript here is not rendered and the tooltip does not appear. Can anybody give me some solution......... Khushi

    Read the article

  • How do I retain uploaded files after POsting a form with a file upload?

    - by Ali
    Hi guys is it possible to be able to retain an uploaded file AFTER its been uploaded I mean I'm building a compose email application. Users can upload files as attachments. AT times out of 10 uploaded files one of them isn't uploaded correctly or the submitted form is invalid the compose page would be displayed again however the user would ned to upload the file again this time. Is it possible to somehow maintain the uploaded files somewhere on the first upload and if the form is invalid - be able to display links to the file uploaded or so?

    Read the article

  • ASP.net drop down dynamically styling and then remembering the styles on aborted submit

    - by peacedog
    So, I've got an ASP drop down list (this is .net 2.0). I'm binding it with data. Basically, when the page loads and it's not a post back we'll fetch record data, bind all the drop downs, and set them to their appropriate values (strictly speaking we: initialize page with basic set of data from DB, bind drop downs from DB, fetch actual record data from DB, set drown downs to appropriate settings at this time). What I want to do is selectively style the list options. So the database returns 3 items: ID, Text, and a flag indicating whether I the record is "active" (and I'll style appropriately). It's easy enough to do and I've done it. My problem is what happens when a form submission is halted. We have slightly extended the Page class and created an AddError() method, which will create a list of errors from failed business rule checks and then display them in a ValidationSummary. It works something like this, in the submit button's click event: CheckBizRules(); if(Page.IsValid) { SaveData(); } If any business rule check fails, the Page will not be valid. The problem is, when the page re-renders (viewsate is enabled, but no data is rebound) my beautiful conditional styling is now sadly gone, off to live in the land of the missing socks. I need to preserve it. I was hoping to avoid another DB call here (e.g. getting the list data back from the DB again if the page isn't valid, just for purposes of re-styling the list). But it's not the end of the world if that's my course of action. I was hoping someone might have an alternative suggestion. I couldn't think of how to phrase this question better, if anyone has any suggestions or needs clarification don't hesitate to get it, by force if need be. ;)

    Read the article

  • drop down not retaining selected value after post back

    - by Bmw
    I'm using classic asp, I have a drop down list that the user selects and then presses submit. After they press submit the drop down list is going back to the default value instead of what they selected. Is there anyway to keep the state of the drop down between post backs instead of it going back to the default? Can post code sample if needed. Thanks!

    Read the article

  • .Net framework 1.1 web application on Safari

    - by Vijay
    We have an intranet web application developed using .NET framework 1.1 The application has few validators and fired from the server side (They are not client side validators). The web application runs perfectly fine on IE and Firefox (both on Mac and Windows). However on Safari(ver 4.0.3) browser running on Mac, the application intermittently fails to do post-back while submitting the page and just reloads the page. Is this issue something to do with .Net framework 1.1 or Safari browser? Is there any way to resolve this issue? Any pointers on this would be very helpful. Thanks!

    Read the article

  • Sign out button reloads all user controls

    - by eych
    I have an aspx page with several user controls (ascx) as well as an asp:button for signing out. The click event of the button clears the session and does a response.redirect to the login page. However, before the click event is called, since the page posts back, all of the Page_Load events run for all of the controls. What is the best way to have the click event code run without unnecessary reloading of all user controls?

    Read the article

  • PHP code not working on IE

    - by Michael Frey
    I have a website with a flag. If it is clicked, the language of the website changes. Here is the code displaying the flag, which is a form with post event: <?php $pagename = $_SERVER['REQUEST_URI']; echo '<form action="'.$pagename.'" method="post"> <input name="formlanguage" type="image" '; if ($_SESSION['lang'] == 0) { echo 'alt="English" src="images/en.png" value="1" '; } else { echo 'alt="Deutsch" src="images/de.png" value="0" '; } echo '/></form>'; ?> Here is the response to that, and this part always fails on IE: if (isset($_POST['formlanguage'])) { $_SESSION['lang']=$_POST['formlanguage']; } I can not figure out why it works on Chrome but not IE. I assume that it might be a setting of IE. But what could that be?

    Read the article

  • When radio button selection changes do not cause refresh?

    - by JPJedi
    When the selection of the radio buttons change I would like to show/hide the panel in the next table cell. I have it hiding and showing fine but each time it causes the page to refresh to the top. Is their a way to stop that refresh? I would like to hide and show the panel dynamically. <table> <tr> <td> <asp:RadioButtonList runat="server" ID="rblPlayerStatus" AutoPostBack="true" > <asp:ListItem>Free Agent</asp:ListItem> <asp:ListItem>I have teammate</asp:ListItem> </asp:RadioButtonList> </td> <td> <asp:Panel runat="server" ID="pnlTeamMate"> <asp:Label runat="server" ID="lblTeamMate" Text="Choose Teammate" /> </asp:Panel> </td> </tr> </table>

    Read the article

  • ASP.NET Bind to IEnumerable

    - by JFoulkes
    Hi, I'm passing a the type IEnumerable to my view, and for each item I output a html.textbox to enter the details into. When I post this back to my controller, the collection is empty and I can't see why. public class Item { public Order Order { get; set; } public string Title { get; set; } public double Price { get; set; } } My Get method: public ActionResult AddItems(Order order) { Item itemOne = new Item { Order = order }; Item itemTwo = new Item { Order = order, }; IList<Item> items = new List<Item> { itemOne, itemTwo }; return View(items); } The View: <% int i = 0; foreach (var item in Model) { %> <p> <label for="Title">Item Title:</label> <%= Html.TextBox("items[" + i + "].Title") %> <%= Html.ValidationMessage("items[" + i + "].Title", "*")%> </p> <p> <label for="Price">Item Price:</label> <%= Html.TextBox("items[" + i + "].Price") %> <%= Html.ValidationMessage("items[" + i + "].Price", "*")%> </p> <% i++; } %> The POST method: [AcceptVerbs(HttpVerbs.Post)] public ActionResult AddItems(IEnumerable<Item> items) { try { return RedirectToAction("Index"); } catch { return View(); } } At the moment i just have a breakpoint on the post method to check what i'm gettin back.

    Read the article

  • How can I ignore an http request without clearing the browser?

    - by Timid Developer
    To prevent duplicate requests (i.e. pressing F5 right after clicking a command button), I've setup my page base class to ignore the request if it's detected as a duplicate. When I say 'ignore' I mean Response.End() Now I thought I've seen this work before, where there's an issue, I just Response.End() and the users page just does nothing. I don't know the exact circumstance in which this worked, but I'm unable to repeat it now. Now when I call Response.End(), I just get an empty browser. More specifically, I get this html. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD> <BODY></BODY></HTML> I setup the following test app to confirm the problem is not elsewhere in my app. Here it is: Add the following to an aspx form <asp:Label ID="lbl" Text="0" runat="server" /><br /> <asp:Button ID="btnAdd1" Text="Add 1" runat="server" /><br /> <asp:Button ID="btnAdd2" Text="Add 2" runat="server" /><br /> <asp:Button ID="btnAdd3" Text="Add 3" runat="server" /><br /> And here's the code behind file using System; namespace TestDupRequestCancellation { public partial class _Default : System.Web.UI.Page { protected void Page_Init(object sender, EventArgs e) { btnAdd1.Click += btnAdd1_Click; btnAdd2.Click += btnAdd2_Click; btnAdd3.Click += btnAdd3_Click; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) CurrentValue = 0; else if (Int32.Parse(lbl.Text) != CurrentValue) Response.End(); } protected void Page_PreRender(object sender, EventArgs e) { lbl.Text = CurrentValue.ToString(); } protected int CurrentValue { get { return Int32.Parse(Session["CurrentValue"].ToString()); } set { Session["CurrentValue"] = value.ToString(); } } void btnAdd3_Click(object sender, EventArgs e) { CurrentValue += 3; } void btnAdd2_Click(object sender, EventArgs e) { CurrentValue += 2; } void btnAdd1_Click(object sender, EventArgs e) { CurrentValue += 1; } } } When you load the page, clicking any button does what is expected, but if you press F5 at any time after pressing one of the buttons, it will detect it as a duplicate request and call Response.End() which promptly ends the task. Which leaves the user with an empty browser. Is there anyway to leave the user with the page as it was, so they can just click a button? Also; please note that this code is the simplest code I could come up with to demonstrate my problem. It's not meant to demonstrate how to check for dup requests.

    Read the article

  • Have ASP page call save function anytime the user tries to navigate away from page

    - by Breander
    What I have is an input page with a bunch of dynamically created textboxes for the user to input data. The textboxes are dynamically created because the number that are needed are not known until the user selects some options on the page. So what I need to have happen is if the user tries to either A) navigate away from the page or B) select different options bringing up new textboxes. Anything the user may have typed into the textboxes needs to automatically be saved to the database. Like they clicked on the save button on the page. This doesn't sound like a vary smart way to do things or even an easy way to do things but this is the requirement I have been given. No message just save to the database. I have looked into things like onbeforepageunload javascript but that mostly tries to stop the user from navigating away I can't call any code behind code from it. Any help is appreciated. Note : The number of the texboxes with data can be any where between 20 and 500. Yes very crazy but not my idea.

    Read the article

  • Elegant solution for multiple forms on single page

    - by NFicano
    I'm building a web application (in Django) that will accept a search criteria and display a report - once the user is satisfied with the results, save both the criteria and a reference to these objects back to the database. The problem I'm having is finding an elegant solution for having 2 forms: Display (GET) the results of their criteria. Enter in some descriptions, and save (POST) everything back to the database. I'm leaning towards AJAX for the GET stuff and a POST for the save, but I wanted to make sure there wasn't a more elegant solution first.

    Read the article

  • run the script only once?

    - by fusion
    being new to php and coming from asp.net, i would like to know if there is an equivalent of IsPostBack, which calls a function or a method only once, once the user is logged in. i have a facebook application, in which once the user authorizes the application it should enter his details in the database. this basic stuff should have been done using the post-authorize callback url which facebook pings when the user first authorizes the app, but somehow that is not working; hence i have to do it manually. the issue is that, since i'm checking whether the user exists or not in index.php, i would not like index.php to run this code repeatedly for the same user when the user goes to the homepage every time. any ideas?

    Read the article

  • How to read a complex view model on POST?

    - by Interfector
    Hello, I have an user view model that has the following properties: public User user; public List<Language> Languages; I send the above model to the view and use html helpers to build the form, so I end up with something like: <form action="/Users/Edit/5" method="post"><input id="user_UserId" name="user.UserId" type="hidden" value="5" /> First Name Last Name Email Language - en en Now, I try to read the POST in something that initially was something like : [AcceptVerbs( HttpVerbs.Post )] public ActionResult Edit( int UserId, FormCollection form ) { and cannot get the user.UserId variable, user.FirstName variable etc. Any idea what needs to be done to be able to read this kind of POST request. I'm kind of reluctant to modifying my ViewModel as it is very simple and easy to maintain as it is. Thank you.

    Read the article

  • ASP.Net: Expiring a page when navigating back

    - by K2so
    Basically all pages on this site I am building cannot be accessed when the user clicks on "Back" (or with key control) in the browser, and the page should expire if one is trying to navigate back in history. I put into Global.asax::Application_BeginRequest Response.Cache.SetCacheability(HttpCacheability.NoCache) Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)) Response.Cache.SetValidUntilExpires(False) Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches) Response.Cache.SetNoStore() This would clear out the cache and disallow going back to any pages when the user is logged out, but doesn't do the job while the user is logged in. I saw posts where people suggested using a javascript approach, by calling History.Forward(1) on the page. But I wouldn't like to do this, as it will require javascript enabled to work (which user can disable). Appreciate any suggestions.

    Read the article

  • How can i preserve list contents on postbacks?

    - by strakastroukas
    On the page load event of my webpage i fill the list of with the contents of the structure Structure MainStruct Dim Ans1 As String Dim Ans2 As String End Structure Dim Build As New List(Of MainStruct) The problem i that on post-back the contents of the list-of get lost. So, how can i preserve the contents of the list-of in ASP.NET?

    Read the article

  • ASP page get current focused control

    - by Breander
    So what I have is a bunch of dynamically created textboxs that when the user enters some data and either tabs out or clicks out some calculations are done. After the page posts back control focus is lost. What I need is to be able to set focus back to the control that was tabbed to or clicked into not the control that data was entered into.

    Read the article

  • Access dynamically generated control from code behind

    - by user648922
    I load a piece of html which contains something like: <em> < input type="text" value="Untitled" name="ViewTitle" id="ViewTitle" runat="server"> </em> into my control. The html is user defined, do please do not ask me to add them statically on the aspx page. On my page, I have a placeholder and I can use LiteralControl target = new LiteralControl (); // html string contains user-defined controls target.text = htmlstring to render it property. My problem is, since its a html piece, even if i know the input box's id, i cannot access it using FindControl("ViewTitle") (it will just return null) because its rendered as a text into a Literal control and all the input controls were not added to the container's control collections. I definitely can use Request.Form["ViewTitle"] to access its value, but how can I set its value?

    Read the article

  • How can I perform a normal postback on an ASP.NET page with AJAX history enabled?

    - by Nick
    I have an ASP.NET 3.5 page with an update panel and history enabled. It works fine when I perform async postbacks but I get problems when I want to perform a normal postback. The page load happens fine for the normal postback but then I get asynchronous page loads from the script manager which load the ajax history in. If I could have the ajax history not loading for the times I want to perform a normal postback then everything would be fine. Is there anyway to do this?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >